A small utility to render pongo2
templates. Intended to be used as a smarter replacement to envsubst
to create smarter configuration files in the context
of containers.
Given the following template file saved in ./examples/test-2.cfg
{% if env.SHELL == "/bin/zsh" %}
is_using_awesome_shell="true"
{% else %}
shell="{{ env.SHELL }}"
home="{{ env.HOME }}"
{% endif %}
The output of
SHELL=/bin/zsh pongo2-runner ./examples/test-2.cfg
is:
is_using_awesome_shell="true"
while the output of
SHELL=/bin/bash pongo2-runner ./examples/test-2.cfg
is:
shell="/bin/bash"
home="/home/username/"
- Go (1.16+)
git clone https://github.com/swisscom/pongo2-runner
cd pongo2-runner
CGO_ENABLED=0 go build -o ./pongo2-runner ./cmd