.
continuous-integration/drone/push Build was killed
Details
continuous-integration/drone/push Build was killed
Details
This commit is contained in:
parent
28d8b22815
commit
9db1dbb349
|
@ -151,7 +151,7 @@ def main(ctx):
|
||||||
#build("guacamole-postgresql"),
|
#build("guacamole-postgresql"),
|
||||||
#build("ngrok-gitea"),
|
#build("ngrok-gitea"),
|
||||||
#build("letsencrypt-nginx"),
|
#build("letsencrypt-nginx"),
|
||||||
#build("drone-starlark"),
|
build("drone-starlark"),
|
||||||
#buildHome(),
|
#buildHome(),
|
||||||
#buildNginx("blog"),
|
#buildNginx("blog"),
|
||||||
#buildNginx("drone"),
|
#buildNginx("drone"),
|
||||||
|
|
|
@ -0,0 +1,34 @@
|
||||||
|
load("@this//:from-secret.star", "fromSecret")
|
||||||
|
load("@this//:map.star", "map")
|
||||||
|
load("@this//:environment.star", "environment")
|
||||||
|
load("@this//:export.star", "export")
|
||||||
|
load("@this//:public-secrets.star", "publicSecrets")
|
||||||
|
load("@this//:secret-secrets.star", "secretSecrets")
|
||||||
|
|
||||||
|
def deploy(
|
||||||
|
filename,
|
||||||
|
folder,
|
||||||
|
):
|
||||||
|
return {
|
||||||
|
"name": "deploy",
|
||||||
|
"image": "appleboy/drone-ssh",
|
||||||
|
"environment": environment(publicSecrets + secretSecrets),
|
||||||
|
"settings": {
|
||||||
|
"envs": [x.replace("-", "_") for x in publicSecrets + secretSecrets ],
|
||||||
|
"host": fromSecret("ssh-host"),
|
||||||
|
"port": fromSecret("ssh-port"),
|
||||||
|
"username": fromSecret("ssh-root-user"),
|
||||||
|
"password": fromSecret("ssh-root-password"),
|
||||||
|
"script": [
|
||||||
|
"set -e"
|
||||||
|
] +
|
||||||
|
map(export, publicSecrets + secretSecrets) +
|
||||||
|
[
|
||||||
|
"docker network prune -f",
|
||||||
|
"cd {folder}".format(folder=folder),
|
||||||
|
"docker stack rm gitea",
|
||||||
|
"sleep 30",
|
||||||
|
"docker stack deploy -c {filename} gitea".format(filename = filename),
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,26 @@
|
||||||
|
load("@this//:from-secret.star", "fromSecret")
|
||||||
|
load("@this//:map.star", "map")
|
||||||
|
load("@this//:environment.star", "environment")
|
||||||
|
load("@this//:export.star", "export")
|
||||||
|
|
||||||
|
def pull(
|
||||||
|
images,
|
||||||
|
):
|
||||||
|
secrets = [ "local-docker-registry"]
|
||||||
|
return {
|
||||||
|
"name": "pull",
|
||||||
|
"image": "appleboy/drone-ssh",
|
||||||
|
"environment": environment(secrets),
|
||||||
|
"settings": {
|
||||||
|
"envs": [x.replace("-", "_") for x in secrets ],
|
||||||
|
"host": fromSecret("ssh-host"),
|
||||||
|
"port": fromSecret("ssh-port"),
|
||||||
|
"username": fromSecret("ssh-root-user"),
|
||||||
|
"password": fromSecret("ssh-root-password"),
|
||||||
|
"script": [
|
||||||
|
"set -e"
|
||||||
|
] +
|
||||||
|
map(export, secrets) +
|
||||||
|
["docker pull $${{LOCAL_DOCKER_REGISTRY}}{image}".format(image=image) for image in images ]
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue