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
echo 'sleeping...zzz'
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(
'guacamole',
'/stack/',
[
'LOCAL_DOCKER_REGISTRY',
'REGISTRY_PASSWORD',

View File

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

View File

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