ssh print an env
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Giles Bradshaw 2020-07-28 16:01:03 +01:00
parent 39692236de
commit aba96f4413
1 changed files with 39 additions and 3 deletions

View File

@ -2,6 +2,37 @@ local util = {
fromSecret(secret): {
from_secret: secret,
},
printEnv(file, env): function(step) step {
environment +: {
[std.asciiHigher(env)]: util.fromSecret(
std.asciiLower(
std.strReplace(
env,
'_',
'-',
),
),
),
},
settings +: {
envs +: [
std.asciiLower(env),
],
script +: [
'echo "export %(environment)=\'$${%(environment)s}\'" >> %(file) # %(secret)s' % {
environment: std.asciiHigher(env),
file: file,
secret: std.asciiLower(
std.strReplace(
env,
'_',
'-',
),
),
},
],
},
},
};
local images = {
docker: {
@ -96,9 +127,14 @@ local images = {
'/stack/root'
),
images.wait(15),
images.ssh {
name: 'ssh nothing',
},
images.printEnv(
'afile',
'ssh_host',
)(
images.ssh {
name: 'will print ssh-host',
},
)
],
}
]