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-home.star

123 lines
3.4 KiB
Plaintext
Raw Normal View History

2020-04-26 13:11:56 +00:00
load("@this//:from-secret.star", "fromSecret")
load("@this//:print-secrets.star", "printSecrets")
2020-04-26 13:44:08 +00:00
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")
2020-04-26 13:58:26 +00:00
load("@this//:wait.star", "wait")
load("@this//:build.star", "build")
load("@this//:scp.star", "scp")
2020-04-28 09:41:09 +00:00
load("@this//stack:public-secrets.star", "publicSecrets")
load("@this//stack:secret-secrets.star", "secretSecrets")
2020-04-26 17:10:20 +00:00
load("@this//:pull.star", "pull")
load("@this//:deploy.star", "deploy")
2020-04-27 14:52:16 +00:00
load("@this//:build-folder.star", "buildFolder")
2020-04-27 15:19:23 +00:00
load("@this//:build-docker-folder.star", "buildDockerFolder")
2020-04-27 16:58:21 +00:00
load("@this//:pipeline.star", "pipeline")
2020-04-26 12:24:13 +00:00
2020-04-24 06:32:20 +00:00
def main(ctx):
2020-04-26 08:22:49 +00:00
if ctx.build.branch == 'home-deploy':
2020-04-26 08:19:22 +00:00
return [
2020-04-26 10:39:42 +00:00
pipeline(
2020-04-26 10:52:28 +00:00
'home-deploy',
[
2020-04-27 16:58:21 +00:00
printSecrets(
"env-stack",
publicSecrets,
secretSecrets,
2020-04-27 19:26:12 +00:00
),
wait(15, "wait"),
2020-04-28 13:17:31 +00:00
#build("guacamole-postgresql"),
#build("ngrok-gitea"),
#build("letsencrypt-nginx"),
#build("drone-starlark"),
2020-04-28 08:42:19 +00:00
buildDockerFolder(
"Dockerfile.home",
"nginx:latest",
"$${LOCAL_DOCKER_REGISTRY}home",
"letsencrypt-nginx",
"home",
),
2020-04-28 11:06:44 +00:00
2020-04-27 19:26:12 +00:00
buildDockerFolder(
"Dockerfile.blog",
"$${LOCAL_DOCKER_REGISTRY}letsencrypt-nginx",
"$${LOCAL_DOCKER_REGISTRY}letsencrypt-blog",
"letsencrypt-nginx",
"blog",
),
buildDockerFolder(
"Dockerfile.drone",
"$${LOCAL_DOCKER_REGISTRY}letsencrypt-nginx",
"$${LOCAL_DOCKER_REGISTRY}letsencrypt-drone",
"letsencrypt-nginx",
"drone",
),
buildDockerFolder(
"Dockerfile.git",
"$${LOCAL_DOCKER_REGISTRY}letsencrypt-nginx",
"$${LOCAL_DOCKER_REGISTRY}letsencrypt-git",
"letsencrypt-nginx",
"git",
),
buildDockerFolder(
"Dockerfile.remote",
"$${LOCAL_DOCKER_REGISTRY}letsencrypt-nginx",
"$${LOCAL_DOCKER_REGISTRY}letsencrypt-remote",
"letsencrypt-nginx",
"remote",
),
buildDockerFolder(
"Dockerfile.chat",
"$${LOCAL_DOCKER_REGISTRY}letsencrypt-nginx",
"$${LOCAL_DOCKER_REGISTRY}letsencrypt-chat",
"letsencrypt-nginx",
"chat",
),
scp("~/gitea-drone-stack"),
pull([
"letsencrypt-git",
"letsencrypt-chat",
"letsencrypt-drone",
"letsencrypt-remote",
"letsencrypt-blog",
"home",
"drone-starlark",
2020-04-27 19:55:45 +00:00
"guacamole-postgresql",
2020-04-27 19:26:12 +00:00
]),
deploy(
"docker-compose-home.yml",
2020-04-27 23:01:53 +00:00
"gitea",
2020-04-27 19:26:12 +00:00
"/home/giles/gitea-drone-stack",
2020-04-28 08:37:19 +00:00
publicSecrets + secretSecrets
2020-04-28 08:29:19 +00:00
2020-04-27 19:26:12 +00:00
),
],
[],
2020-04-27 19:45:28 +00:00
[
{
"name": "ca",
"host": {
"path": "/home/giles/gitea-drone-stack/.ca",
},
}
],
[
{
"name": "ca",
"path": "/etc/docker/certs.d",
},
]
2020-04-27 19:26:12 +00:00
),
]
2020-04-27 23:46:28 +00:00
else:
2020-04-27 23:49:50 +00:00
return pipeline(
ctx.build.branch,
[],
[],
[],
[],
)