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

This commit is contained in:
Giles Bradshaw 2020-07-28 16:34:37 +01:00
parent 50f728e77e
commit e25ca5057f
1 changed files with 38 additions and 4 deletions

View File

@ -1,4 +1,33 @@
local secrets = [
'ssh-host'
];
local util = {
// the head of an array
head(array): array[0],
// the tail of an array
tail(array): std.makeArray(
std.length(array) -1,
function(x) array[x + 1],
),
// compose an array of functions
compose(functions):
local compose(functions) =
if std.length(functions) == 0
then
local ret(object) = object;
ret
else
local ret(object) = compose(
utils.tail(
functions,
)
)(
utils.head(
functions,
)(object)
);
ret;
compose(functions),
fromSecret(secret): {
from_secret: secret,
},
@ -136,12 +165,17 @@ local images = {
'/stack/root'
),
images.wait(15),
util.printEnv(
'afile',
'ssh_host',
util.compose(
std.map(
function(secret) util.printEnv(secret, 'afile'),
secrets,
)
)(
images.ssh {
name: 'will print ssh-host',
name: 'will print ssh-host again',
settings +: [
'rm afile'
],
},
)
],