Skip to content

zooplus/tpl

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

140 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tpl

build GitHub Release Date

tpl is build for generating config files from templates using simple or complex (lists, maps, objects) shell environment variables. Since the binary has zero dependencies it is build for Docker but you can use it across all platform and operating systems.

tpl uses sprig to extend golang's template capabilities.

Check the test section and have a look at test/test.tpl (template) and test/test.txt (result) in test folder for examples.

setup

Just download the binary for your OS and arch from the releases page.

If you want to use it inside your docker image you can add this to your Dockerfile:

ADD https://github.com/zooplus/tpl/releases/download/v0.12.6/tpl-linux-amd64 /usr/local/bin/tpl
RUN chmod a+x /usr/local/bin/tpl

build

Local:

go install github.com/zooplus/tpl@latest

Cross platform builds happen on dedicated runners on GitHub Actions.

export GOOS=linux
export GOARCH=amd64
export CGO_ENABLED=0    # for static binary
go build \
    -o bin/tpl \
    .

unit test

go test -v

integration tests

./test.sh

About

Use go templates with simple and complex environment variables

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • Go 79.3%
  • Go Template 13.4%
  • Shell 7.3%