Skip to content

webhippie/templater

Repository files navigation

Templater

General Workflow Join the Matrix chat at https://matrix.to/#/#webhippie:matrix.org Codacy Badge Go Reference Go Report Card GitHub Repo Hosted By: Cloudsmith

Templater is used by our docker containers to provide a functionality for clean templating based on the Golang text/template package. The variables are always provided through environment variables. Before we integrated templater every template has been handled by envsubst which doesn't provide any control structures while Golang templates got this builtin.

Install

You can download prebuilt binaries from the GitHub releases or from our download site. Besides that we also prepared repositories for DEB and RPM packages which can be found at Cloudsmith. If you prefer to use containers you could use our images published on GHCR, Docker Hub or Quay. If you need further guidance how to install this take a look at our documentation.

Package repository hosting is graciously provided by Cloudsmith. Cloudsmith is the only fully hosted, cloud-native, universal package management solution, that enables your organization to create, store and share packages in any format, to any place, with total confidence.

Build

If you are not familiar with Nix it is up to you to have a working environment for Go (>= 1.24.0) as the setup won't we covered within this guide. Please follow the official install instructions for Go. Beside that we are using go-task to define all commands to build this project.

git clone https://github.com/webhippie/templater.git
cd templater

task build
./bin/templater -h

If you got Nix and Direnv configured you can simply execute the following commands to get al dependencies including go-task and the required runtimes installed. You are also able to directly use the process manager of devenv:

cat << EOF > .envrc
use flake . --impure --extra-experimental-features nix-command
EOF

direnv allow

Development

To start developing on this project you have to execute only one command to build a binary matching your platform:

task build

After that you can simply execute the tool via bin/templater -h.

Security

If you find a security issue please contact thomas@webhippie.de first.

Contributing

Fork -> Patch -> Push -> Pull Request

Authors

License

Apache-2.0

Copyright

Copyright (c) 2018 Thomas Boerger <thomas@webhippie.de>

About

Template processor for env variables

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors 7