provisioning-catalog/components/ontoref_panel/cluster/vars.nu

23 lines
726 B
Text
Raw Permalink Normal View History

#!/usr/bin/env nu
# Derived variables for ontoref-panel bundle rendering.
# Reads panel_ncl_path from disk and provides it as a template variable.
def main [component_json: string]: nothing -> nothing {
let d = ($component_json | from json)
let panel_ncl_path = ($d | get -o panel_ncl_path | default "config/panel.ncl")
let panel_ncl_content = if ($panel_ncl_path | path exists) {
open $panel_ncl_path
} else {
error make { msg: $"panel_ncl_path not found: ($panel_ncl_path)" }
}
{
panel_ncl_content: $panel_ncl_content,
mail_data_mount: "/tmp/docker-mailserver",
setup_proxy_path: "/usr/local/bin/dms-setup-proxy.sh",
}
| to json --raw
| print
}