https://github.com/swisscom/pongo2-runner
A small utility to render pongo2 templates
https://github.com/swisscom/pongo2-runner
Last synced: 2 months ago
JSON representation
A small utility to render pongo2 templates
- Host: GitHub
- URL: https://github.com/swisscom/pongo2-runner
- Owner: swisscom
- License: mit
- Created: 2021-03-11T18:10:24.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-04-07T11:57:15.000Z (about 3 years ago)
- Last Synced: 2026-03-27T23:42:26.049Z (3 months ago)
- Language: Go
- Size: 19.5 KB
- Stars: 5
- Watchers: 12
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# pongo2-runner
A small utility to render [pongo2](https://github.com/flosch/pongo2)
templates. Intended to be used as a smarter replacement to `envsubst`
to create smarter configuration files in the context
of containers.
## Example
Given the following template file saved in `./examples/test-2.cfg`
```sh
{% if env.SHELL == "/bin/zsh" %}
is_using_awesome_shell="true"
{% else %}
shell="{{ env.SHELL }}"
home="{{ env.HOME }}"
{% endif %}
```
The output of
```sh
SHELL=/bin/zsh pongo2-runner ./examples/test-2.cfg
```
is:
```sh
is_using_awesome_shell="true"
```
while the output of
```sh
SHELL=/bin/bash pongo2-runner ./examples/test-2.cfg
```
is:
```sh
shell="/bin/bash"
home="/home/username/"
```
## Compiling
### Requirements
- Go (1.16+)
### Compiling statically
```bash
git clone https://github.com/swisscom/pongo2-runner
cd pongo2-runner
CGO_ENABLED=0 go build -o ./pongo2-runner ./cmd
```