mend
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
2b86e1e751
commit
22f59b648a
|
@ -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),
|
||||
},
|
||||
],
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue