-
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.
[JENKINS-28317] withEnv does not support nesting
Resolution | New: Fixed [ 1 ] | |
Status | Original: Open [ 1 ] | New: Resolved [ 5 ] |
Workflow | Original: JNJira [ 163153 ] | New: JNJira + In-Review [ 197116 ] |
Component/s | New: pipeline-general [ 21692 ] |
Component/s | Original: workflow-plugin [ 18820 ] |