An orb to render Go templates in CircleCI using Gomplate
In order to use this orb, just add it under the orbs
section of your CircleCI .circleci/config.yml
:
orbs:
gomplate: xaventois/[email protected]
This command takes a template file and the input contexts/datasources and renders the template.
version: 2.1
orbs:
gomplate: xaventois/[email protected]
jobs:
render-greeting:
executor: gomplate/gomplate
steps:
- run:
name: "Generate greeting template and input values"
command: |
echo "Hello, {{ .values.name }}!" > greet.txt.tmpl
echo "name: CircleCI" > values.yaml
- gomplate/render-template:
template-file: greet.txt.tmpl
output-file: greet.txt
contexts: values.yaml
- run:
name: "Output greeting"
command: |
cat test.txt
workflows:
greeting:
jobs:
- render-greeting
This job is designed to be used as part of a Dynamic Config setup workflow. It automatically calls the continuation/continue
job upon rendering the template.
version: 2.1
setup: true
orbs:
gomplate: xaventois/[email protected]
workflows:
use-my-orb:
jobs:
- gomplate/render-config:
template-file: .circleci/continue_config.yml.tmpl
output-file: .circleci/continue_config.yml
pre-steps:
- run:
command: |
echo '{ "a": "b", list: ["x", "y", "z"] }' > values.yaml
contexts: values.yaml
Documentation for this orb - The official registry page of this orb for all versions, executors, commands, and jobs described.
CircleCI Orb Docs - Docs for using, creating, and publishing CircleCI Orbs.
We welcome issues to and pull requests against this repository!
MIT