Merge branch 'home-deploy' into remote
continuous-integration/drone/push Build was killed
Details
continuous-integration/drone/push Build was killed
Details
This commit is contained in:
commit
e7829c2a45
129
.drone.star
129
.drone.star
|
@ -13,69 +13,9 @@ load("@this//:public-secrets.star", "publicSecrets")
|
|||
load("@this//:secret-secrets.star", "secretSecrets")
|
||||
load("@this//:pull.star", "pull")
|
||||
load("@this//:deploy.star", "deploy")
|
||||
|
||||
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",
|
||||
},
|
||||
},
|
||||
],
|
||||
}
|
||||
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 == 'home-deploy':
|
||||
|
@ -83,16 +23,59 @@ def main(ctx):
|
|||
pipeline(
|
||||
'home-deploy',
|
||||
[
|
||||
#build("guacamole-postgresql"),
|
||||
#build("ngrok-gitea"),
|
||||
#build("letsencrypt-nginx"),
|
||||
printSecrets(
|
||||
"env-stack",
|
||||
publicSecrets,
|
||||
secretSecrets,
|
||||
),
|
||||
wait(15, "wait"),
|
||||
build("guacamole-postgresql"),
|
||||
build("ngrok-gitea"),
|
||||
build("letsencrypt-nginx"),
|
||||
build("drone-starlark"),
|
||||
#buildHome(),
|
||||
#buildNginx("blog"),
|
||||
#buildNginx("drone"),
|
||||
#buildNginx("git"),
|
||||
#buildNginx("remote"),
|
||||
#buildNginx("chat"),
|
||||
buildDockerFolder(
|
||||
"Dockerfile.home",
|
||||
"nginx:latest",
|
||||
"$${LOCAL_DOCKER_REGISTRY}home",
|
||||
"letsencrypt-nginx",
|
||||
"home",
|
||||
),
|
||||
|
||||
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",
|
||||
|
@ -100,7 +83,7 @@ def main(ctx):
|
|||
"letsencrypt-drone",
|
||||
"letsencrypt-remote",
|
||||
"letsencrypt-blog",
|
||||
"nginx-home1",
|
||||
"home",
|
||||
"drone-starlark",
|
||||
]),
|
||||
deploy(
|
||||
|
|
|
@ -347,7 +347,7 @@ services:
|
|||
replicas: 1
|
||||
restart_policy:
|
||||
condition: any
|
||||
image: ${LOCAL_DOCKER_REGISTRY}nginx-home1
|
||||
image: ${LOCAL_DOCKER_REGISTRY}home
|
||||
environment:
|
||||
- SERVER_NAME=${BLOG_DOMAIN}
|
||||
ports:
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
load("@this//:environment.star", "environment")
|
||||
def buildDockerFolder(
|
||||
dockerFile,
|
||||
image,
|
||||
tag,
|
||||
folder,
|
||||
name,
|
||||
):
|
||||
return {
|
||||
"name": "build-{name}".format(
|
||||
name = name,
|
||||
),
|
||||
"image": "docker:dind",
|
||||
"volumes": [
|
||||
{
|
||||
"name": "dockersock",
|
||||
"path": "/var/run",
|
||||
},
|
||||
],
|
||||
"environment": environment([
|
||||
"local-docker-registry",
|
||||
]),
|
||||
"commands": [
|
||||
"cd {folder}".format(folder=folder),
|
||||
"sh build-docker-folder.sh {dockerFile} {image} {tag}".format(
|
||||
image = image,
|
||||
dockerFile = dockerFile,
|
||||
tag = tag,
|
||||
),
|
||||
],
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
load("@this//:environment.star", "environment")
|
||||
def buildDockerFolder(
|
||||
dockerFile,
|
||||
image,
|
||||
tag,
|
||||
folder,
|
||||
name,
|
||||
):
|
||||
return {
|
||||
"name": "build-{name}".format(
|
||||
name = name,
|
||||
),
|
||||
"image": "docker:dind",
|
||||
"volumes": [
|
||||
{
|
||||
"name": "dockersock",
|
||||
"path": "/var/run",
|
||||
},
|
||||
],
|
||||
"environment": environment([
|
||||
"local-docker-registry",
|
||||
]),
|
||||
"commands": [
|
||||
"cd {folder}".format(folder=folder),
|
||||
"sh build-docker-folder.sh {dockerFile} {image} {tag}".format(
|
||||
image = image,
|
||||
dockerFile = dockerFile,
|
||||
tag = tag,
|
||||
),
|
||||
],
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
def pipeline(
|
||||
name,
|
||||
steps,
|
||||
dependsOn,
|
||||
):
|
||||
return {
|
||||
"kind": "pipeline",
|
||||
"name": name,
|
||||
"depends_on": dependsOn,
|
||||
"steps": 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",
|
||||
},
|
||||
},
|
||||
],
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
set -e
|
||||
docker build . -f $1 --build-arg image=$2 -t $3
|
||||
docker push $3
|
Reference in New Issue