Reworked templater to produce docker compose and minikube output

This commit is contained in:
Cyber MacGeddon 2024-09-08 21:55:37 +01:00
parent 19625d1cde
commit 713d903293
59 changed files with 37925 additions and 7034 deletions

View file

@ -0,0 +1,29 @@
local components = import "components.jsonnet";
local apply = function(p, components)
local component = components[p.name];
(component + {
with:: function(k, v) self + {
[k]:: v
},
with_params:: function(pars)
self + std.foldl(
function(obj, par) obj.with(par.key, par.value),
std.objectKeysValues(pars),
self
),
}).with_params(p.parameters);
local decode = function(config)
local add = function(state, c) state + apply(c, components);
local patterns = std.foldl(add, config, {});
patterns;
decode