diff --git a/build.sh b/.drone/build.sh similarity index 100% rename from build.sh rename to .drone/build.sh diff --git a/deploy.sh b/.drone/deploy.sh similarity index 50% rename from deploy.sh rename to .drone/deploy.sh index 172bacc..42f70dc 100644 --- a/deploy.sh +++ b/.drone/deploy.sh @@ -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 diff --git a/.drone/drone-home.jsonnet b/.drone/drone-home.jsonnet index c4dbc7b..e3b001a 100644 --- a/.drone/drone-home.jsonnet +++ b/.drone/drone-home.jsonnet @@ -9,6 +9,7 @@ local deploy = import 'lib/deploy.libsonnet'; [ deploy( 'guacamole', + '/stack/', [ 'LOCAL_DOCKER_REGISTRY', 'REGISTRY_PASSWORD', diff --git a/.drone/lib/build.libsonnet b/.drone/lib/build.libsonnet index f9cc21f..0020d62 100644 --- a/.drone/lib/build.libsonnet +++ b/.drone/lib/build.libsonnet @@ -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', ], } \ No newline at end of file diff --git a/.drone/lib/deploy.libsonnet b/.drone/lib/deploy.libsonnet index 7643fe3..7bf31bb 100644 --- a/.drone/lib/deploy.libsonnet +++ b/.drone/lib/deploy.libsonnet @@ -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', ] } }, diff --git a/login.sh b/.drone/login.sh similarity index 100% rename from login.sh rename to .drone/login.sh diff --git a/logout.sh b/.drone/logout.sh similarity index 100% rename from logout.sh rename to .drone/logout.sh diff --git a/pull.sh b/.drone/pull.sh similarity index 100% rename from pull.sh rename to .drone/pull.sh diff --git a/push.sh b/.drone/push.sh similarity index 100% rename from push.sh rename to .drone/push.sh