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

This commit is contained in:
Giles Bradshaw 2020-07-28 16:06:47 +01:00
parent 2b86e1e751
commit 22f59b648a
1 changed files with 26 additions and 17 deletions

View File

@ -2,33 +2,42 @@ local util = {
fromSecret(secret): {
from_secret: secret,
},
secret(secret): std.asciiLower(
std.strReplace(
secret,
'_',
'-',
),
),
environment(secret): std.asciiUpper(
std.strReplace(
secret,
'-',
'_',
),
),
env(secret): std.asciiLower(
std.strReplace(
secret,
'-',
'_',
),
),
printEnv(file, env): function(step) step {
environment +: {
[std.asciiHigher(env)]: util.fromSecret(
std.asciiLower(
std.strReplace(
env,
'_',
'-',
),
),
[util.environment(env)]: util.fromSecret(
util.secret(env)
),
},
settings +: {
envs +: [
std.asciiLower(env),
util.env(env),
],
script +: [
'echo "export %(environment)=\'$${%(environment)s}\'" >> %(file) # %(secret)s' % {
environment: std.asciiHigher(env),
environment: util.environment(env),
file: file,
secret: std.asciiLower(
std.strReplace(
env,
'_',
'-',
),
),
secret: util.secret(env),
},
],
},