Skip to content

Instantly share code, notes, and snippets.

@SwampDragons
Created August 23, 2019 21:07
Show Gist options
  • Save SwampDragons/10e39d1b392e8917dbd06308a88e9d39 to your computer and use it in GitHub Desktop.
Save SwampDragons/10e39d1b392e8917dbd06308a88e9d39 to your computer and use it in GitHub Desktop.
Power of Golang Templating Engine
{
"variables": {
"option_1": "foo",
"option_2": "bar"
},
"builders": [
{
"type": "null",
"name": "AWESOME-POSSUM",
"communicator": "none"
}
],
"provisioners": [
{
"type": "shell-local",
"inline": "echo {{with split build_name \"-\" 0}}{{if eq . \"AWESOME\"}}{{ user `option_1` }}{{else}}{{user `option_2`}}{{ end }}{{end}}"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment