.
continuous-integration/drone/push Build was killed Details

This commit is contained in:
Giles Bradshaw 2020-04-27 21:17:33 +01:00
parent f3f3e357a0
commit 9127904430
2 changed files with 119 additions and 1 deletions

79
.drone-remote.star Normal file
View File

@ -0,0 +1,79 @@
load("@this//:from-secret.star", "fromSecret")
load("@this//:print-secrets.star", "printSecrets")
load("@this//:map.star", "map")
load("@this//:environment.star", "environment")
load("@this//:echo.star", "echo")
load("@this//:export.star", "export")
load("@this//:echo-secret.star", "echoSecret")
load("@this//:wait.star", "wait")
load("@this//:build.star", "build")
load("@this//:scp.star", "scp")
load("@this//:public-secrets.star", "publicSecrets")
load("@this//:secret-secrets.star", "secretSecrets")
load("@this//:pull.star", "pull")
load("@this//:deploy.star", "deploy")
load("@this//:build-folder.star", "buildFolder")
load("@this//:build-docker-folder.star", "buildDockerFolder")
load("@this//:pipeline.star", "pipeline")
def main(ctx):
if ctx.build.branch == 'remote':
return [
pipeline(
'home-deploy',
[
printSecrets(
"env-stack",
publicSecrets,
secretSecrets,
),
wait(15, "wait"),
build("guacamole-postgresql"),
build("ngrok-gitea"),
build("letsencrypt-nginx"),
build("drone-starlark"),
buildDockerFolder(
"Dockerfile.drone",
"$${LOCAL_DOCKER_REGISTRY}letsencrypt-nginx",
"$${LOCAL_DOCKER_REGISTRY}letsencrypt-drone",
"letsencrypt-nginx",
"drone",
),
buildDockerFolder(
"Dockerfile.remote",
"$${LOCAL_DOCKER_REGISTRY}letsencrypt-nginx",
"$${LOCAL_DOCKER_REGISTRY}letsencrypt-remote",
"letsencrypt-nginx",
"remote",
),
scp("~/gitea-drone-stack"),
pull([
"letsencrypt-drone",
"letsencrypt-remote",
"drone-starlark",
"guacamole-postgresql",
]),
deploy(
"docker-compose-remote.yml",
"/home/giles/gitea-drone-stack",
),
],
[],
[
{
"name": "ca",
"host": {
"path": "/home/giles/gitea-drone-stack/.ca",
},
}
],
[
{
"name": "ca",
"path": "/etc/docker/certs.d",
},
]
),
]

View File

@ -9,7 +9,46 @@ def deploy(
filename,
folder,
):
return {
return {if ctx.build.branch == 'do':
return [
pipeline(
'do',
[
printSecrets(
"env-stack",
publicSecrets,
secretSecrets,
),
clear("/home/giles/stack-deploy"),
wait(15, "wait"),
build("guacamole-postgresql"),
build("letsencrypt-nginx"),
build("drone-starlark"),
buildDockerFolder(
"Dockerfile.do",
"$${LOCAL_DOCKER_REGISTRY}letsencrypt-nginx",
"$${LOCAL_DOCKER_REGISTRY}letsencrypt-do",
"letsencrypt-nginx",
"do",
),
scp("/home/giles/stack-deploy"),
pull([
"letsencrypt-do",
"drone-starlark",
"guacamole-postgresql",
]),
deploy(
"docker-compose-do.yml",
"/home/giles/gitea-drone-stack",
),
],
[],
[],
[],
),
]
"name": "deploy",
"image": "appleboy/drone-ssh",
"environment": environment(publicSecrets + secretSecrets),