Commit d5bddb9e authored by Kamil Trzciński's avatar Kamil Trzciński 💬

Make variables to work at job level in exec mode

parent 541d92c3
Pipeline #2976033 passed with stage
v 1.2.0 (unreleased)
- Extend version information when using `--version` flag
- Make checkout quiet
- Make variables to work at job level in exec mode
v 1.1.0
- Use Go 1.5
......
......@@ -101,6 +101,21 @@ func (c *ExecCommand) buildVariables(configVariables interface{}) (buildVariable
return
}
func (c *ExecCommand) buildGlobalAndJobVariables(global, job interface{}) (buildVariables common.BuildVariables, err error) {
buildVariables, err = c.buildVariables(global)
if err != nil {
return
}
jobVariables, err := c.buildVariables(job)
if err != nil {
return
}
buildVariables = append(buildVariables, jobVariables...)
return
}
func (c *ExecCommand) buildOptions(config, jobConfig common.BuildOptions) (options common.BuildOptions, err error) {
options = make(common.BuildOptions)
......@@ -151,7 +166,7 @@ func (c *ExecCommand) parseYaml(job string, build *common.GetBuildResponse) erro
return err
}
build.Variables, err = c.buildVariables(config["variables"])
build.Variables, err = c.buildGlobalAndJobVariables(config["variables"], jobConfig["variables"])
if err != nil {
return err
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment