.
continuous-integration/drone/push Build was killed
Details
continuous-integration/drone/push Build was killed
Details
This commit is contained in:
parent
f7c6310aa8
commit
86caa6e7a1
|
@ -1,31 +0,0 @@
|
||||||
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,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
}
|
|
|
@ -1,35 +0,0 @@
|
||||||
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,
|
|
||||||
name,
|
|
||||||
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 {name}".format(name = name),
|
|
||||||
"sleep 30",
|
|
||||||
"docker stack deploy -c {filename} {name}".format(name= name, filename = filename),
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -7,6 +7,7 @@ load("@this//:secret-secrets.star", "secretSecrets")
|
||||||
|
|
||||||
def deploy(
|
def deploy(
|
||||||
filename,
|
filename,
|
||||||
|
name,
|
||||||
folder,
|
folder,
|
||||||
):
|
):
|
||||||
return {
|
return {
|
||||||
|
@ -26,9 +27,9 @@ def deploy(
|
||||||
[
|
[
|
||||||
"docker network prune -f",
|
"docker network prune -f",
|
||||||
"cd {folder}".format(folder=folder),
|
"cd {folder}".format(folder=folder),
|
||||||
"docker stack rm gitea",
|
"docker stack rm {name}".format(name = name),
|
||||||
"sleep 30",
|
"sleep 30",
|
||||||
"docker stack deploy -c {filename} gitea".format(filename = filename),
|
"docker stack deploy -c {filename} {name}".format(name= name, filename = filename),
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Reference in New Issue