From 015ac53c5bbe6100658b9fd1a6295a276407e0c1 Mon Sep 17 00:00:00 2001 From: Giles Bradshaw Date: Thu, 27 Aug 2020 00:28:07 +0100 Subject: [PATCH] ci: deploy on promote --- .drone-do.star | 14 -------------- .drone-home.star | 17 ----------------- .drone/drone-home.jsonnet | 13 ++++++++++++- .drone/package.json | 2 +- .drone/yarn.lock | 8 ++++---- 5 files changed, 17 insertions(+), 37 deletions(-) delete mode 100644 .drone-do.star delete mode 100644 .drone-home.star diff --git a/.drone-do.star b/.drone-do.star deleted file mode 100644 index d7d2e39..0000000 --- a/.drone-do.star +++ /dev/null @@ -1,14 +0,0 @@ - -load("@this//drone:drone.star", "drone") -load("@this//drone:stack-name.star", "stackName") -load("@this//drone:stack-root.star", "stackRoot") - -def main(ctx): - return drone( - ctx, - "do", - stackRoot, - stackName, - [] - ) - \ No newline at end of file diff --git a/.drone-home.star b/.drone-home.star deleted file mode 100644 index 9326beb..0000000 --- a/.drone-home.star +++ /dev/null @@ -1,17 +0,0 @@ - -load("@this//drone:drone.star", "drone") -load("@this//drone:stack-name.star", "stackName") -load("@this//drone:stack-root.star", "stackRoot") - -def main(ctx): - return drone( - ctx, - "home-deploy", - stackRoot, - stackName, - [ - "docker service scale proxy_letsencrypt-drone=0", - "docker service scale proxy_letsencrypt-drone=1", - ] - ) - \ No newline at end of file diff --git a/.drone/drone-home.jsonnet b/.drone/drone-home.jsonnet index c9c248f..6ae54e2 100644 --- a/.drone/drone-home.jsonnet +++ b/.drone/drone-home.jsonnet @@ -3,7 +3,9 @@ local secretSecrets = import 'lib/secret-secrets.libsonnet'; local publicSecrets = import 'lib/public-secrets.libsonnet'; local deploy = import 'node_modules/@sigyl/jsonnet-drone/deploy.libsonnet'; +local register = import 'node_modules/@sigyl/jsonnet-drone/register.libsonnet'; [ + register, deploy( 'drone', '/stack/', @@ -13,5 +15,14 @@ local deploy = import 'node_modules/@sigyl/jsonnet-drone/deploy.libsonnet'; ], publicSecrets, secretSecrets - ), + ) { + trigger +: { + event +: [ + 'promote', + ], + target +: [ + 'production', + ], + }, + }, ] diff --git a/.drone/package.json b/.drone/package.json index 45387ae..2609cd8 100644 --- a/.drone/package.json +++ b/.drone/package.json @@ -4,6 +4,6 @@ "build": "drone jsonnet --source drone-home.jsonnet --target drone-home.yml --stream" }, "dependencies": { - "@sigyl/jsonnet-drone": "^0.0.7" + "@sigyl/jsonnet-drone": "^0.0.8" } } diff --git a/.drone/yarn.lock b/.drone/yarn.lock index b97ecd6..d1aa19a 100644 --- a/.drone/yarn.lock +++ b/.drone/yarn.lock @@ -12,10 +12,10 @@ resolved "https://registry.yarnpkg.com/@sigyl/jsonnet-drone-environment/-/jsonnet-drone-environment-0.0.5.tgz#9ea85e08904777bd21a3e4b30b0b91461d0285ff" integrity sha512-xVGmdMO1pOyozAWUbJm6mzKBgsLPJ+1hWnGCK3AxPkr7kkDh18hu30+TLzlcQtqq76s5jUfvJUztezsGj/mIcw== -"@sigyl/jsonnet-drone@^0.0.7": - version "0.0.7" - resolved "https://registry.yarnpkg.com/@sigyl/jsonnet-drone/-/jsonnet-drone-0.0.7.tgz#0f92ef15096b0c5497741ff56bfbd249de9edd66" - integrity sha512-353n/zExNnKPPZ235eLX3/DFXJVNIX8fdAeG3RvY+55538eGzDIk0/3HJd8jXsD6y0zxm+LexW5HghvXBMBOEA== +"@sigyl/jsonnet-drone@^0.0.8": + version "0.0.8" + resolved "https://registry.yarnpkg.com/@sigyl/jsonnet-drone/-/jsonnet-drone-0.0.8.tgz#f928e6784bccf1abb82afed3cab6e435c62d2e93" + integrity sha512-BuFVawb7z3aUYqHCBqykgALjF07crnN2H7+WLo8crH3vT7FPMLbYdoTv7N98P8OhZBKv6KvBQep6uZK3Reho5g== dependencies: "@sigyl/jsonnet-compose" "^0.0.2" "@sigyl/jsonnet-drone-environment" "0.0.5"