Skip to content

Xavientois/gomplate-orb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gomplate Orb

CircleCI Build Status CircleCI Orb Version GitHub License CircleCI Community

An orb to render Go templates in CircleCI using Gomplate

Usage

In order to use this orb, just add it under the orbs section of your CircleCI .circleci/config.yml:

orbs:
    gomplate: xaventois/gomplate@1.2.3

Examples

render-template command

This command takes a template file and the input contexts/datasources and renders the template.

version: 2.1

orbs:
    gomplate: xaventois/gomplate@0.1.0

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

render-config job

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/gomplate@0.1.0

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

Resources

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.

How to Contribute

We welcome issues to and pull requests against this repository!

Licence

MIT

About

A CircleCI orb to render Go templates using Gomplate

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages