fix: fixed settings for ssh and scp
continuous-integration/drone/push Build is failing Details

This commit is contained in:
Giles Bradshaw 2020-08-05 08:44:33 +01:00
parent 240addaf02
commit 49db6e397c
3 changed files with 14 additions and 39 deletions

View File

@ -12,17 +12,9 @@ steps:
image: appleboy/drone-scp image: appleboy/drone-scp
settings: settings:
command_timeout: 2m command_timeout: 2m
host:
from_secret: ssh-host
key:
from_secret: ssh-key
port:
from_secret: ssh-port
source: source:
- . - .
target: /stack/squid target: /stack/squid
username:
from_secret: ssh-user
- name: wait - name: wait
image: alpine image: alpine
@ -43,12 +35,6 @@ steps:
- ssh_root_user - ssh_root_user
- ssh_password - ssh_password
- ssh_key - ssh_key
host:
from_secret: ssh-host
password:
from_secret: ssh-password
port:
from_secret: ssh-port
script: script:
- set -e - set -e
- docker network prune -f - docker network prune -f
@ -69,8 +55,6 @@ steps:
- echo "$${SSH_PASSWORD}" - echo "$${SSH_PASSWORD}"
- export SSH_KEY="$${SSH_KEY}" - export SSH_KEY="$${SSH_KEY}"
- echo "$${SSH_KEY}" - echo "$${SSH_KEY}"
username:
from_secret: ssh-user
environment: environment:
SSH_HOST: SSH_HOST:
from_secret: ssh-host from_secret: ssh-host

View File

@ -1,28 +1,14 @@
local util = import 'util.libsonnet'; local util = import 'util.libsonnet';
local settings = import 'settings.libsonnet';
{ {
docker: { docker: {
name: 'docker', name: 'docker',
image: 'docker:dind', image: 'docker:dind',
}, },
scp(target): { scp(target): settings.ssh {
name: 'scp', name: 'scp',
image: 'appleboy/drone-scp', image: 'appleboy/drone-scp',
settings: { settings +: {
host: {
from_secret: 'ssh-host',
},
username: {
from_secret: 'ssh-user',
},
/*password: {
from_secret: 'ssh-password',
},*/
key: {
from_secret: 'ssh-key',
},
port: {
from_secret: 'ssh-port',
},
command_timeout: '2m', command_timeout: '2m',
target: target, target: target,
source: [ source: [
@ -30,13 +16,9 @@ local util = import 'util.libsonnet';
], ],
}, },
}, },
ssh: { ssh: settings.ssh {
image: 'appleboy/drone-ssh', image: 'appleboy/drone-ssh',
settings: { settings +: {
host: util.fromSecret("ssh-host"),
port: util.fromSecret("ssh-port"),
username: util.fromSecret("ssh-user"),
password: util.fromSecret("ssh-password"),
envs: [ envs: [
'drone_tag', 'drone_tag',
'drone_commit', 'drone_commit',

View File

@ -0,0 +1,9 @@
local util = import 'util.libsonnet';
{
ssh: {
host: util.fromSecret('ssh-host'),
port: util.fromSecret('ssh-port'),
username: util.fromSecret('ssh-user'),
key: util.fromSecret('ssh-key'),
},
}