ci: more generic jsonnet
continuous-integration/drone/push Build is failing Details

This commit is contained in:
Giles Bradshaw 2020-08-14 13:22:00 +01:00
parent 1f3371ca47
commit c335b3f511
9 changed files with 14 additions and 12 deletions

View File

@ -1,4 +1,4 @@
docker stack rm guacamole docker stack rm guacamole
echo 'sleeping...zzz' echo 'sleeping...zzz'
sleep 60 sleep 60
docker stack deploy -c docker-compose.yml guacamole docker stack deploy -c ../docker-compose.yml guacamole

View File

@ -9,6 +9,7 @@ local deploy = import 'lib/deploy.libsonnet';
[ [
deploy( deploy(
'guacamole', 'guacamole',
'/stack/',
[ [
'LOCAL_DOCKER_REGISTRY', 'LOCAL_DOCKER_REGISTRY',
'REGISTRY_PASSWORD', 'REGISTRY_PASSWORD',

View File

@ -13,9 +13,9 @@ function(secrets)
], ],
commands: [ commands: [
'set -e', 'set -e',
'sh login.sh', 'sh .drone/login.sh',
'sh build.sh', 'sh .drone/build.sh',
'sh push.sh', 'sh .drone/push.sh',
'sh logout.sh', 'sh .drone/logout.sh',
], ],
} }

View File

@ -6,6 +6,7 @@ local util = import 'util.libsonnet';
function( function(
name, name,
root,
buildSecrets, buildSecrets,
publicSecrets, publicSecrets,
secretSecrets secretSecrets
@ -48,7 +49,7 @@ function(
steps:[ steps:[
compose( compose(
std.map( std.map(
function(secret) util.printEnv('env-guacamole', secret), function(secret) util.printEnv('env-%s' % name, secret),
publicSecrets, publicSecrets,
) )
) )
@ -56,7 +57,7 @@ function(
images.ssh { images.ssh {
settings +: { settings +: {
script: [ script: [
'rm -f env-guacamole', 'rm -f env-%s' % name,
], ],
}, },
}, },
@ -64,7 +65,7 @@ function(
name: 'print env', name: 'print env',
}, },
images.scp( images.scp(
'/stack/guacamole' '%(root)%(name)s' % { root: root, name: name }
), ),
images.wait(15), images.wait(15),
build(buildSecrets), build(buildSecrets),
@ -87,10 +88,10 @@ function(
) + ) +
[ [
'set -e', 'set -e',
"cd /stack/guacamole", 'cd %(root)%(name)s' % { root: root, name: name },
'docker login $${LOCAL_DOCKER_REGISTRY} --username client --password "$${REGISTRY_PASSWORD}"', 'sh .drone/login.sh',
'sh pull.sh', 'sh .drone/pull.sh',
'sh deploy.sh', 'sh .drone/deploy.sh',
] ]
} }
}, },