Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-58367

cwd set by exws set is replaced by withEnv and withCredentials steps

    Details

    • Similar Issues:

      Description

      Hi, 

      I am experiencing an unexpected change of the current working directory when withEnv or withCredentials steps are used.

      dir step is a viable workaround, but I am wondering if there is a more straightforward explanation and solution.

      Thank you!

      def extWorkspace = exwsAllocate diskPoolId: 'workspace-pool', strategy: fastestWriteSpeed()

      stage('init') {
        node('brenode') {
          println pwd() //prints local workspace (${JENKINS_HOME}/workspace/${JOB_NAME})
          exws (extWorkspace) {
            println pwd() //prints external workspace ${physical_path}/${JOB_NAME}/${BUILD_NUMBER}
            withEnv(["1=1"])

      {          println pwd() //prints again local workspace!       }

          }
        }
      }

       

        Attachments

          Activity

          There are no comments yet on this issue.

            People

            • Assignee:
              alexsomai Alexandru Somai
              Reporter:
              claudiuavat1 Claudiu Avatamanitei
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: