2020-08-05 07:30:16 +00:00
|
|
|
local compose = import '../node_modules/@sigyl/jsonnet-compose/compose.libsonnet';
|
2020-08-05 11:06:47 +00:00
|
|
|
local environment = import '../node_modules/@sigyl/jsonnet-drone-environment/environment.libsonnet';
|
2020-08-05 07:30:16 +00:00
|
|
|
{
|
|
|
|
printEnv(file, env): function(step) compose([
|
2020-08-05 11:06:47 +00:00
|
|
|
environment.envSet(env),
|
2020-08-05 07:30:16 +00:00
|
|
|
function(step) step {
|
|
|
|
settings +: {
|
|
|
|
script +: [
|
|
|
|
'echo "export %(environment)s=\'$${%(environment)s}\'" >> %(file)s # "%(secret)s"' % {
|
2020-08-05 11:06:47 +00:00
|
|
|
environment: environment.environment(env),
|
2020-08-05 07:30:16 +00:00
|
|
|
file: file,
|
2020-08-05 11:06:47 +00:00
|
|
|
secret: environment.secret(env),
|
2020-08-05 07:30:16 +00:00
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
])(step),
|
|
|
|
}
|