diff --git a/README.md b/README.md index 0868404..ea6a8e3 100644 --- a/README.md +++ b/README.md @@ -43,9 +43,9 @@ like a version on the fly. #### Parameters * `job_path`: (required) Path of the HCL job file to run * `vars`: { [key: string]: string } dictionary of variables to substitute in the job file. Each key - should be represented in the job file as `{{.key}}` + should be represented in the job file as `{{+.key+}}` * `var_files`: { [key: string]: string } dictionary of paths to files to read to get variable - values. Each key should be represented in the job file as `{{.key}}` and the values should be path + values. Each key should be represented in the job file as `{{+.key+}}` and the values should be path to text files which content will be used as the variable value. Whitespace and trailing newlines will be trimmed from the value. * `templating`: { bool }: Whether to use templating or not. `true` by default @@ -103,10 +103,10 @@ job "sample" { driver = "docker" config { - image = "cioplenu/sample:{{.version}}" + image = "cioplenu/sample:{{+.version+}}" auth = { username = "some-username" - password = "{{.registry_token}}" + password = "{{+.registry_token+}}" } force_pull = true } diff --git a/out/main.go b/out/main.go index 56ddb30..0e5cf2a 100644 --- a/out/main.go +++ b/out/main.go @@ -48,7 +48,7 @@ func main() { templFile, err := ioutil.ReadFile(templPath) common.Check(err, "Could not read input file "+templPath) if config.Params.Templating != false { - tmpl, err := template.New("job").Parse(string(templFile)) + tmpl, err := template.New("job").Delims("{{+", "+}}").Parse(string(templFile)) common.Check(err, "Error parsing template") for name, path := range config.Params.VarFiles {