Open adamantike opened 2 months ago
These variables derive from the support for go templates for all config files. These templates have very limited default functionality and a strict syntax (though they can be extended with functions, e.g. like done here )
That said there are 2 options right now to perform what you’d like to achieve:
{{ $healthchecksURL := "https://healthchecks.com" }}
{{ $healthchecksURLProj1 := (printf "%s%s" $healthchecksURL "/ping/uuid1") }}
{{ $healthchecksURLProj2 := (list $healthchecksURL "/ping/uuid2" | join "") }}
Problem
Currently, hand-made variables do not support nesting, which sometimes helps to reduce duplication and simplify configuration files.
Here is a simple example, trying to reuse a single Healthchecks host URL across multiple projects:
Running
show
indicates that no variable expansion was done when initializing$healthchecksURLProj1
:Proposed solution