• Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • pipeline
    • 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

          Code changed in jenkins
          User: Jesse Glick
          Path:
          CHANGES.md
          http://jenkins-ci.org/commit/workflow-plugin/9aba34f91cfcc36873497c5aefc239d631869e00
          Log:
          [FIXED JENKINS-28317] Noting that this was recently fixed.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: CHANGES.md http://jenkins-ci.org/commit/workflow-plugin/9aba34f91cfcc36873497c5aefc239d631869e00 Log: [FIXED JENKINS-28317] Noting that this was recently fixed.

            jglick Jesse Glick
            sumdumgai A C
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: