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

This commit is contained in:
Giles Bradshaw 2020-04-26 18:06:31 +01:00
parent 28d8b22815
commit 9db1dbb349
3 changed files with 61 additions and 1 deletions

View File

@ -151,7 +151,7 @@ def main(ctx):
#build("guacamole-postgresql"), #build("guacamole-postgresql"),
#build("ngrok-gitea"), #build("ngrok-gitea"),
#build("letsencrypt-nginx"), #build("letsencrypt-nginx"),
#build("drone-starlark"), build("drone-starlark"),
#buildHome(), #buildHome(),
#buildNginx("blog"), #buildNginx("blog"),
#buildNginx("drone"), #buildNginx("drone"),

View File

@ -0,0 +1,34 @@
load("@this//:from-secret.star", "fromSecret")
load("@this//:map.star", "map")
load("@this//:environment.star", "environment")
load("@this//:export.star", "export")
load("@this//:public-secrets.star", "publicSecrets")
load("@this//:secret-secrets.star", "secretSecrets")
def deploy(
filename,
folder,
):
return {
"name": "deploy",
"image": "appleboy/drone-ssh",
"environment": environment(publicSecrets + secretSecrets),
"settings": {
"envs": [x.replace("-", "_") for x in publicSecrets + secretSecrets ],
"host": fromSecret("ssh-host"),
"port": fromSecret("ssh-port"),
"username": fromSecret("ssh-root-user"),
"password": fromSecret("ssh-root-password"),
"script": [
"set -e"
] +
map(export, publicSecrets + secretSecrets) +
[
"docker network prune -f",
"cd {folder}".format(folder=folder),
"docker stack rm gitea",
"sleep 30",
"docker stack deploy -c {filename} gitea".format(filename = filename),
]
}
}

View File

@ -0,0 +1,26 @@
load("@this//:from-secret.star", "fromSecret")
load("@this//:map.star", "map")
load("@this//:environment.star", "environment")
load("@this//:export.star", "export")
def pull(
images,
):
secrets = [ "local-docker-registry"]
return {
"name": "pull",
"image": "appleboy/drone-ssh",
"environment": environment(secrets),
"settings": {
"envs": [x.replace("-", "_") for x in secrets ],
"host": fromSecret("ssh-host"),
"port": fromSecret("ssh-port"),
"username": fromSecret("ssh-root-user"),
"password": fromSecret("ssh-root-password"),
"script": [
"set -e"
] +
map(export, secrets) +
["docker pull $${{LOCAL_DOCKER_REGISTRY}}{image}".format(image=image) for image in images ]
}
}