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

148 lines
3.6 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-26 16:11:26 +00:00
load("@this//:public-secrets.star", "publicSecrets")
load("@this//: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-26 12:24:13 +00:00
2020-04-25 20:49:57 +00:00
def buildHome():
return {
"name": "build-nginx-home",
"image": "docker:dind",
"volumes": [
{
"name": "dockersock",
"path": "/var/run",
},
],
"environment": environment([
"local-docker-registry",
]),
"commands": [
2020-04-25 21:24:24 +00:00
"cd letsencrypt-nginx",
2020-04-25 21:37:21 +00:00
"sh build.home.sh $${{LOCAL_DOCKER_REGISTRY}}".format(),
2020-04-25 20:49:57 +00:00
],
}
2020-04-26 10:39:42 +00:00
def pipeline(name, steps, dependsOn):
2020-04-25 20:14:33 +00:00
return {
"kind": "pipeline",
"name": name,
"depends_on": dependsOn,
"steps": [
2020-04-26 08:54:48 +00:00
printSecrets(
"env-stack",
2020-04-26 16:11:26 +00:00
publicSecrets,
secretSecrets,
2020-04-26 08:54:48 +00:00
),
2020-04-25 21:57:48 +00:00
wait(15, "wait"),
2020-04-26 10:39:42 +00:00
] + steps,
2020-04-25 20:07:36 +00:00
"services": [
{
"name": "docker",
"image": "docker:dind",
"privileged": True,
"volumes": [
{
"name": "dockersock",
"path": "/var/run",
},
{
"name": "ca",
"path": "/etc/docker/certs.d",
},
],
}
],
"volumes": [
{
"name": "dockersock",
"temp": {},
},
{
"name": "ca",
"host": {
"path": "/home/giles/gitea-drone-stack/.ca",
},
},
],
2020-04-24 10:07:57 +00:00
}
2020-04-24 06:58:20 +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',
[
#build("guacamole-postgresql"),
#build("ngrok-gitea"),
#build("letsencrypt-nginx"),
2020-04-26 17:06:31 +00:00
build("drone-starlark"),
2020-04-26 10:52:28 +00:00
#buildHome(),
2020-04-27 15:30:56 +00:00
#buildDockerFolder(
# "Dockerfile.home",
# "nginx:latest",
# "home",
# "letsencrypt-nginx"
#),
2020-04-27 15:25:17 +00:00
2020-04-27 15:19:23 +00:00
buildDockerFolder(
"Dockerfile.blog",
"letsencrypt-nginx",
"letsencrypt-blog",
"letsencrypt-nginx"
),
2020-04-27 15:25:17 +00:00
buildDockerFolder(
"Dockerfile.drone",
"letsencrypt-nginx",
"letsencrypt-drone",
"letsencrypt-nginx"
),
buildDockerFolder(
"Dockerfile.git",
"letsencrypt-nginx",
"letsencrypt-git",
"letsencrypt-nginx"
),
buildDockerFolder(
"Dockerfile.remote",
"letsencrypt-nginx",
"letsencrypt-remote",
"letsencrypt-nginx"
),
buildDockerFolder(
"Dockerfile.chat",
"letsencrypt-nginx",
"letsencrypt-chat",
"letsencrypt-nginx"
),
2020-04-26 12:59:31 +00:00
scp("~/gitea-drone-stack"),
2020-04-26 16:44:57 +00:00
pull([
"letsencrypt-git",
"letsencrypt-chat",
"letsencrypt-drone",
"letsencrypt-remote",
"letsencrypt-blog",
2020-04-27 15:25:17 +00:00
"home",
2020-04-26 16:44:57 +00:00
"drone-starlark",
]),
2020-04-26 10:52:28 +00:00
deploy(
"docker-compose-home.yml",
2020-04-26 13:00:59 +00:00
"/home/giles/gitea-drone-stack",
2020-04-26 10:52:28 +00:00
),
],
[],
),
]
2020-04-24 09:56:09 +00:00