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