A small utility to render pongo2 templates | Read-only mirror of https://github.com/swisscom/pongo2-runner — Swisscom. Issues & pull requests at the source.
  • Go 75.7%
  • Makefile 20.9%
  • Dockerfile 3.4%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2022-08-16 18:53:54 +02:00
cmd/pongo2-runner feat: use fmt.Print instead of fmt.Printf 2022-08-16 18:53:33 +02:00
examples feat: use fmt.Print instead of fmt.Printf 2022-08-16 18:53:33 +02:00
pkg feat: general improvements 2022-08-16 18:10:36 +02:00
.dockerignore feat: general improvements 2022-08-16 18:10:36 +02:00
.gitignore feat: general improvements 2022-08-16 18:10:36 +02:00
Dockerfile fix: Dockerfile build 2022-08-16 18:15:14 +02:00
Dockerfile.build build: build binaries using Docker 2022-08-16 18:53:54 +02:00
go.mod feat: general improvements 2022-08-16 18:10:36 +02:00
go.sum feat: general improvements 2022-08-16 18:10:36 +02:00
LICENSE.md initial commit 2021-03-11 19:07:31 +01:00
Makefile build: build binaries using Docker 2022-08-16 18:53:54 +02:00
README.md doc: CGO -> CGO_ENABLED 2021-03-11 20:12:00 +01:00

pongo2-runner

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.

Example

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/"

Compiling

Requirements

  • Go (1.16+)

Compiling statically

git clone https://github.com/swisscom/pongo2-runner
cd pongo2-runner
CGO_ENABLED=0 go build -o ./pongo2-runner ./cmd