.
continuous-integration/drone/push Build was killed
Details
continuous-integration/drone/push Build was killed
Details
This commit is contained in:
parent
6f9ed00399
commit
9c7ae96daf
|
@ -0,0 +1,32 @@
|
||||||
|
def echo(secret):
|
||||||
|
return 'echo "export {environment}=${environment}" >> ***filename*** # {secret}'.format(
|
||||||
|
secret = secret,
|
||||||
|
environment = secret.replace("-", "_").upper(),
|
||||||
|
)
|
||||||
|
def echoSecret(secret):
|
||||||
|
return 'echo "export {environment}=???" >> ***filename*** # {secret}'.format(
|
||||||
|
secret = secret,
|
||||||
|
environment = secret.replace("-", "_").upper()
|
||||||
|
)
|
||||||
|
|
||||||
|
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)]
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue