.
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Giles Bradshaw 2020-04-26 14:44:08 +01:00
parent f080701eb8
commit 9d4b012ae9
1 changed files with 5 additions and 22 deletions

View File

@ -1,29 +1,12 @@
load("@this//:from-secret.star", "fromSecret") load("@this//:from-secret.star", "fromSecret")
load("@this//:print-secrets.star", "printSecrets") load("@this//:print-secrets.star", "printSecrets")
def environment(env): load("@this//:map.star", "map")
return dict( load("@this//:environment.star", "environment")
[(x.replace("-", "_").upper(), fromSecret(x)) for x in env] load("@this//:echo.star", "echo")
) load("@this//:export.star", "export")
def map(fn, l): load("@this//:echo-secret.star", "echoSecret")
return [fn(x) for x in l]
def secretToEnvironment(secret):
return secret.replace("-", "_").upper()
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 wait(delay, name): def wait(delay, name):
return { return {
"name": name, "name": name,