.
continuous-integration/drone/push Build was killed Details

This commit is contained in:
Giles Bradshaw 2020-04-26 11:11:20 +01:00
parent 846a46076d
commit 33559d4b84
1 changed files with 3 additions and 3 deletions

View File

@ -11,12 +11,12 @@ def map(fn, l):
def secretToEnvironment(secret): def secretToEnvironment(secret):
return secret.replace("-", "_").upper() return secret.replace("-", "_").upper()
def echo(secret): def echo(secret):
return 'echo "export {environment}=${environment}" >> $$filename$$ # {secret}'.format( return 'echo "export {environment}=${environment}" >> ***filename*** # {secret}'.format(
secret = secret, secret = secret,
environment = secret.replace("-", "_").upper(), environment = secret.replace("-", "_").upper(),
) )
def echoSecret(secret): def echoSecret(secret):
return 'echo 'export {environment}=???' >> $$filename$$ # {secret}'.format( return 'echo "export {environment}=???" >> ***filename*** # {secret}'.format(
secret = secret, secret = secret,
environment = secret.replace("-", "_").upper() environment = secret.replace("-", "_").upper()
) )
@ -37,7 +37,7 @@ def printSecrets(filename, env, secretEnv):
"port": fromSecret("ssh-port"), "port": fromSecret("ssh-port"),
"username": fromSecret("ssh-user"), "username": fromSecret("ssh-user"),
"password": fromSecret("ssh-password"), "password": fromSecret("ssh-password"),
"script": [x.replace("$$filename$$", filename) for x in [ "script": [x.replace("***filename***", filename) for x in [
"rm -f env-stack", "rm -f env-stack",
] + map(echo, env) ] + map(echo, env)
+ map(echoSecret, secretEnv)] + map(echoSecret, secretEnv)]