Add ability to interpolate during build

Now build takes a --values argument, which is a yaml file that can be
used to interpolate the specs that are going to be compiled.
This commit is contained in:
Ettore Di Giacinto
2020-11-27 22:22:20 +01:00
parent 44d33eceba
commit 0fe30ddcfd
13 changed files with 321 additions and 14 deletions

View File

@@ -92,7 +92,7 @@ func (r *CompilerRecipe) Load(path string) error {
compileDefPath := pack.Rel(CompilerDefinitionFile)
if helpers.Exists(compileDefPath) {
dat, err := helpers.RenderFiles(compileDefPath, currentpath)
dat, err := helpers.RenderFiles(compileDefPath, currentpath, "")
if err != nil {
return errors.Wrap(err,
"Error templating file "+CompilerDefinitionFile+" from "+
@@ -137,7 +137,7 @@ func (r *CompilerRecipe) Load(path string) error {
if err != nil {
return errors.Wrap(err, "Error reading file "+currentpath)
}
dat, err := helpers.RenderHelm(string(buildyaml), raw)
dat, err := helpers.RenderHelm(string(buildyaml), raw, map[string]interface{}{})
if err != nil {
return errors.Wrap(err,
"Error templating file "+CompilerDefinitionFile+" from "+