This repository has been archived on 2020-08-11. You can view files and clone it, but cannot push or open issues or pull requests.
stack/.drone-remote.star

88 lines
2.4 KiB
Plaintext
Raw Normal View History

2020-04-27 20:17:33 +00:00
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")
2020-04-27 22:57:25 +00:00
load("@this//:deploy.star", "deploy")
2020-04-27 20:17:33 +00:00
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(
2020-04-28 11:06:44 +00:00
'remote-deploy',
2020-04-27 20:17:33 +00:00
[
printSecrets(
"env-stack",
publicSecrets,
secretSecrets,
),
wait(15, "wait"),
2020-04-27 21:17:51 +00:00
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",
),
2020-04-27 20:58:57 +00:00
scp("/home/giles/gitea-drone-stack"),
2020-04-27 20:17:33 +00:00
pull([
"letsencrypt-drone",
"letsencrypt-remote",
"drone-starlark",
"guacamole-postgresql",
]),
deploy(
"docker-compose-remote.yml",
2020-04-27 21:06:32 +00:00
"remote-drone",
2020-04-27 20:17:33 +00:00
"/home/giles/gitea-drone-stack",
2020-04-28 08:48:30 +00:00
publicSecrets + secretSecrets,
2020-04-27 20:17:33 +00:00
),
],
[],
[
{
"name": "ca",
"host": {
"path": "/home/giles/gitea-drone-stack/.ca",
},
}
],
[
{
"name": "ca",
"path": "/etc/docker/certs.d",
},
]
),
]
2020-04-27 23:46:28 +00:00
else:
2020-04-27 23:58:39 +00:00
return pipeline(
ctx.build.branch,
[],
[],
[],
[],
)