trustgraph/templates/main.jsonnet

25 lines
533 B
Jsonnet
Raw Normal View History

2024-08-22 00:19:55 +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"), ",");
// Produce patterns from config
local patterns = std.foldl(
function(state, p) state + components[p],
options,
{}
);
2024-08-22 00:19:55 +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
std.manifestYamlDoc(resources)
2024-08-22 00:19:55 +01:00