1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2025-01-18 05:18:24 +02:00

fix(config): consider defaults with higher prio than env (#2725)

* fix(config): properly handle empty values from cpe

* fix(config): consider defaults with higher prio than env
This commit is contained in:
Oliver Nocon 2021-03-29 10:40:04 +02:00 committed by GitHub
parent d15b67f882
commit 24cb3c92e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -179,6 +179,9 @@ func (c *Config) GetStepConfig(flagValues map[string]interface{}, paramJSON stri
// initialize with defaults from step.yaml
stepConfig.mixInStepDefaults(parameters)
// merge parameters provided by Piper environment
stepConfig.mixIn(envParameters, filters.All)
// read defaults & merge general -> steps (-> general -> steps ...)
for _, def := range c.defaults.Defaults {
def.ApplyAliasConfig(parameters, secrets, filters, stageName, stepName, stepAliases)
@ -193,9 +196,6 @@ func (c *Config) GetStepConfig(flagValues map[string]interface{}, paramJSON stri
}
}
// merge parameters provided by Piper environment
stepConfig.mixIn(envParameters, filters.All)
// read config & merge - general -> steps -> stages
stepConfig.mixIn(c.General, filters.General)
stepConfig.mixIn(c.Steps[stepName], filters.Steps)