tsubst

command module
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 14, 2021 License: MIT Imports: 5 Imported by: 0

README

tsubst

Substitute environment variables on GO templates

Example - Basic Usage

Given the following "template.yml" file:

job1:
  environment: {{.ENV}}

Run this:

$ export ENV=prod
$ tsubst template.yml > prod.yml
$ cat prod.yml
job1:
  environment: prod

Example - Conditionals

Given the following "template.yml" file:

server-deployment:
  {{if eq .MODE "basic"}}
  instances: 1
  {{else}}
  instances: 3
  {{end}}

Run this:

$ export MODE=basic
$ tsubst template.yml > basic.yml
$ cat basic.yml
server-deployment:
  instances: 1

More information

For a complete reference on the template syntax and capabilities, see the GO template library documentation.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL