.
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):
|
||||
return {
|
||||
"from_secret": name
|
||||
}
|
||||
load("@this//:from-secret.star", "fromSecret")
|
||||
load("@this//:print-secrets.star", "printSecrets")
|
||||
|
||||
def environment(env):
|
||||
return dict(
|
||||
[(x.replace("-", "_").upper(), fromSecret(x)) for x in env]
|
||||
|
@ -25,24 +24,6 @@ def export(secret):
|
|||
return "export {toCaps}=${toCaps}".format(
|
||||
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):
|
||||
return {
|
||||
"name": name,
|
||||
|
@ -176,7 +157,7 @@ def deploy(
|
|||
"docker network prune -f",
|
||||
"cd {folder}".format(folder=folder),
|
||||
"docker stack rm gitea",
|
||||
"sleep 60",
|
||||
"sleep 30",
|
||||
"docker stack deploy -c {filename} gitea".format(filename = filename),
|
||||
]
|
||||
}
|
||||
|
|
Reference in New Issue