.
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
82a9b7ec26
commit
9ce5e7b16b
27
.drone.star
27
.drone.star
|
@ -1,7 +1,6 @@
|
||||||
def fromSecret(name):
|
load("@this//:from-secret.star", "fromSecret")
|
||||||
return {
|
load("@this//:print-secrets.star", "printSecrets")
|
||||||
"from_secret": name
|
|
||||||
}
|
|
||||||
def environment(env):
|
def environment(env):
|
||||||
return dict(
|
return dict(
|
||||||
[(x.replace("-", "_").upper(), fromSecret(x)) for x in env]
|
[(x.replace("-", "_").upper(), fromSecret(x)) for x in env]
|
||||||
|
@ -25,24 +24,6 @@ def export(secret):
|
||||||
return "export {toCaps}=${toCaps}".format(
|
return "export {toCaps}=${toCaps}".format(
|
||||||
toCaps = secretToEnvironment(secret),
|
toCaps = secretToEnvironment(secret),
|
||||||
)
|
)
|
||||||
def printSecrets(filename, env, secretEnv):
|
|
||||||
|
|
||||||
return {
|
|
||||||
"name": "print secrets",
|
|
||||||
"image": "appleboy/drone-ssh",
|
|
||||||
"environment": environment(env),
|
|
||||||
"settings": {
|
|
||||||
"envs": [x.replace("-", "_") for x in env ],
|
|
||||||
"host": fromSecret("ssh-host"),
|
|
||||||
"port": fromSecret("ssh-port"),
|
|
||||||
"username": fromSecret("ssh-user"),
|
|
||||||
"password": fromSecret("ssh-password"),
|
|
||||||
"script": [x.replace("***filename***", filename) for x in [
|
|
||||||
"rm -f env-stack",
|
|
||||||
] + map(echo, env)
|
|
||||||
+ map(echoSecret, secretEnv)]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
def wait(delay, name):
|
def wait(delay, name):
|
||||||
return {
|
return {
|
||||||
"name": name,
|
"name": name,
|
||||||
|
@ -176,7 +157,7 @@ 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 gitea",
|
||||||
"sleep 60",
|
"sleep 30",
|
||||||
"docker stack deploy -c {filename} gitea".format(filename = filename),
|
"docker stack deploy -c {filename} gitea".format(filename = filename),
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
Reference in New Issue