jsonnet-drone/lib/util.libsonnet

18 lines
603 B
Plaintext
Raw Normal View History

2020-08-15 09:43:20 +00:00
local compose = import '../node_modules/@sigyl/jsonnet-compose/compose.libsonnet';
local environment = import '../node_modules/@sigyl/jsonnet-drone-environment/environment.libsonnet';
{
printEnv(file, env): function(step) compose([
environment.envSet(env),
function(step) step {
settings +: {
script +: [
'echo "export %(environment)s=\'$${%(environment)s}\'" >> %(file)s # "%(secret)s"' % {
environment: environment.environment(env),
file: file,
secret: environment.secret(env),
},
],
},
},
])(step),
}