-
Bug
-
Resolution: Fixed
-
Major
-
None
-
Jenkins 1.6.11
Workflow 1.6
A nested withEnv step clobbers its parent withEnv. Test code:
withEnv(['FOO=BAR']) {
echo "${env.FOO}"
withEnv(['ALICE=BOB']){
echo "${env.ALICE}"
echo "${env.FOO}"
}
}
Results in the output:
BAR
BOB
null
Nested withEnv steps should properly merge and un-merge with their parents. Only workaround appears to be manually managing nested environments. This significantly hobbles the use of withEnv in complex builds.