.
continuous-integration/drone/push Build is failing Details

This commit is contained in:
Giles Bradshaw 2020-04-26 11:52:28 +01:00
parent af9564f438
commit e8528b7a5e
1 changed files with 32 additions and 15 deletions

View File

@ -132,7 +132,10 @@ def scp(target):
], ],
}, },
} }
def deploy(): def deploy(
filename,
folder,
):
secrets = [ secrets = [
"drone-rpc-secret", "drone-rpc-secret",
"drone-gitea-client-id", "drone-gitea-client-id",
@ -168,10 +171,10 @@ def deploy():
"docker pull $${LOCAL_DOCKER_REGISTRY}letsencrypt-blog", "docker pull $${LOCAL_DOCKER_REGISTRY}letsencrypt-blog",
"docker pull $${LOCAL_DOCKER_REGISTRY}letsencrypt-drone", "docker pull $${LOCAL_DOCKER_REGISTRY}letsencrypt-drone",
"docker network prune -f", "docker network prune -f",
"cd /home/$SSH_USER/gitea-drone-stack", "cd {folder}".format(folder=folder),
"docker stack rm gitea", "docker stack rm gitea",
"sleep 60", "sleep 60",
"docker stack deploy -c docker-compose-home.yml gitea", "docker stack deploy -c {filename} gitea".format(filename = filename),
] ]
} }
} }
@ -238,10 +241,32 @@ def main(ctx):
if ctx.build.branch == 'home-deploy': if ctx.build.branch == 'home-deploy':
return [ return [
pipeline( pipeline(
'home', 'home-deploy',
[
#build("guacamole-postgresql"),
#build("ngrok-gitea"),
#build("letsencrypt-nginx"),
#buildHome(),
#buildNginx("blog"),
#buildNginx("drone"),
#buildNginx("git"),
#buildNginx("remote"),
#buildNginx("chat"),
scp("~/gitea-drone-stack"),
deploy(
"docker-compose-home.yml",
"~/gitea-drone-stack",
),
],
[],
),
]
if ctx.build.branch == 'do':
return [
pipeline(
'do-deploy',
[ [
build("guacamole-postgresql"), build("guacamole-postgresql"),
build("ngrok-gitea"),
build("letsencrypt-nginx"), build("letsencrypt-nginx"),
buildHome(), buildHome(),
buildNginx("blog"), buildNginx("blog"),
@ -249,18 +274,10 @@ def main(ctx):
buildNginx("git"), buildNginx("git"),
buildNginx("remote"), buildNginx("remote"),
buildNginx("chat"), buildNginx("chat"),
scp("~/gitea-drone-stack"), scp("~/stack-deploy"),
deploy(), #deploy("docker-compose-do.yml", "~/stack-deploy"),
], ],
[], [],
), ),
] ]
else:
return [
pipeline(
'first',
[],
[],
),
]