2024-08-22 00:19:55 +01:00
|
|
|
|
2024-09-05 16:40:47 +01:00
|
|
|
local engine = import "docker-compose.jsonnet";
|
|
|
|
|
local decode = import "decode-config.jsonnet";
|
|
|
|
|
local components = import "components.jsonnet";
|
|
|
|
|
|
|
|
|
|
// Options
|
2024-08-22 00:19:55 +01:00
|
|
|
local options = std.split(std.extVar("options"), ",");
|
|
|
|
|
|
2024-09-05 16:40:47 +01:00
|
|
|
// Produce patterns from config
|
|
|
|
|
local patterns = std.foldl(
|
|
|
|
|
function(state, p) state + components[p],
|
|
|
|
|
options,
|
|
|
|
|
{}
|
|
|
|
|
);
|
2024-08-22 00:19:55 +01:00
|
|
|
|
2024-09-05 16:40:47 +01:00
|
|
|
// Extract resources usnig the engine
|
|
|
|
|
local resources = std.foldl(
|
|
|
|
|
function(state, p) state + p.create(engine),
|
|
|
|
|
std.objectValues(patterns),
|
|
|
|
|
{}
|
|
|
|
|
);
|
2024-08-22 00:19:55 +01:00
|
|
|
|
2024-09-05 16:40:47 +01:00
|
|
|
std.manifestYamlDoc(resources)
|
2024-08-22 00:19:55 +01:00
|
|
|
|