added option to turn off templating
This commit is contained in:
@@ -6,6 +6,7 @@ type Source struct {
|
|||||||
Token string `json:"token"`
|
Token string `json:"token"`
|
||||||
ConsulToken string `json:"consul_token"`
|
ConsulToken string `json:"consul_token"`
|
||||||
VaultToken string `json:"vault_token"`
|
VaultToken string `json:"vault_token"`
|
||||||
|
Templating bool `json:"templating"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type JobVersion struct {
|
type JobVersion struct {
|
||||||
|
@@ -45,6 +45,7 @@ func main() {
|
|||||||
templPath := filepath.Join(sourceDir, config.Params.JobPath)
|
templPath := filepath.Join(sourceDir, config.Params.JobPath)
|
||||||
templFile, err := ioutil.ReadFile(templPath)
|
templFile, err := ioutil.ReadFile(templPath)
|
||||||
common.Check(err, "Could not read input file "+templPath)
|
common.Check(err, "Could not read input file "+templPath)
|
||||||
|
if ( config.Source.Templating != false ) {
|
||||||
tmpl, err := template.New("job").Parse(string(templFile))
|
tmpl, err := template.New("job").Parse(string(templFile))
|
||||||
common.Check(err, "Error parsing template")
|
common.Check(err, "Error parsing template")
|
||||||
|
|
||||||
@@ -65,6 +66,7 @@ func main() {
|
|||||||
defer outFile.Close()
|
defer outFile.Close()
|
||||||
_, err = outFile.Write(buf.Bytes())
|
_, err = outFile.Write(buf.Bytes())
|
||||||
common.Check(err, "Error writing output file")
|
common.Check(err, "Error writing output file")
|
||||||
|
}
|
||||||
|
|
||||||
cmd := exec.Command(
|
cmd := exec.Command(
|
||||||
"nomad",
|
"nomad",
|
||||||
|
Reference in New Issue
Block a user