148 lines
3.6 KiB
Plaintext
148 lines
3.6 KiB
Plaintext
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")
|
|
load("@this//:deploy.star", "deploy")
|
|
load("@this//:build-folder.star", "buildFolder")
|
|
load("@this//:build-docker-folder.star", "buildDockerFolder")
|
|
|
|
def buildHome():
|
|
return {
|
|
"name": "build-nginx-home",
|
|
"image": "docker:dind",
|
|
"volumes": [
|
|
{
|
|
"name": "dockersock",
|
|
"path": "/var/run",
|
|
},
|
|
],
|
|
"environment": environment([
|
|
"local-docker-registry",
|
|
]),
|
|
"commands": [
|
|
"cd letsencrypt-nginx",
|
|
"sh build.home.sh $${{LOCAL_DOCKER_REGISTRY}}".format(),
|
|
],
|
|
}
|
|
|
|
def pipeline(name, steps, dependsOn):
|
|
return {
|
|
"kind": "pipeline",
|
|
"name": name,
|
|
"depends_on": dependsOn,
|
|
"steps": [
|
|
printSecrets(
|
|
"env-stack",
|
|
publicSecrets,
|
|
secretSecrets,
|
|
),
|
|
wait(15, "wait"),
|
|
] + steps,
|
|
"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",
|
|
},
|
|
},
|
|
],
|
|
}
|
|
|
|
def main(ctx):
|
|
if ctx.build.branch == 'home-deploy':
|
|
return [
|
|
pipeline(
|
|
'home-deploy',
|
|
[
|
|
#build("guacamole-postgresql"),
|
|
#build("ngrok-gitea"),
|
|
#build("letsencrypt-nginx"),
|
|
build("drone-starlark"),
|
|
#buildHome(),
|
|
#buildDockerFolder(
|
|
# "Dockerfile.home",
|
|
# "nginx:latest",
|
|
# "home",
|
|
# "letsencrypt-nginx"
|
|
#),
|
|
|
|
buildDockerFolder(
|
|
"Dockerfile.blog",
|
|
"letsencrypt-nginx",
|
|
"letsencrypt-blog",
|
|
"letsencrypt-nginx"
|
|
),
|
|
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"
|
|
),
|
|
scp("~/gitea-drone-stack"),
|
|
pull([
|
|
"letsencrypt-git",
|
|
"letsencrypt-chat",
|
|
"letsencrypt-drone",
|
|
"letsencrypt-remote",
|
|
"letsencrypt-blog",
|
|
"home",
|
|
"drone-starlark",
|
|
]),
|
|
deploy(
|
|
"docker-compose-home.yml",
|
|
"/home/giles/gitea-drone-stack",
|
|
),
|
|
],
|
|
[],
|
|
),
|
|
]
|
|
|