ci: deploy on promote

This commit is contained in:
Giles Bradshaw 2020-08-27 00:28:07 +01:00
parent af8d7a3caa
commit 015ac53c5b
5 changed files with 17 additions and 37 deletions

View File

@ -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,
[]
)

View File

@ -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",
]
)

View File

@ -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',
],
},
},
]

View File

@ -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"
}
}

View File

@ -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"