[JIRA] (JENKINS-58367) cwd set by exws set is replaced by withEnv and withCredentials steps

2 views
Skip to first unread message

claudiu.avat@gmail.com (JIRA)

unread,
Jul 5, 2019, 5:12:02 PM7/5/19
to jenkinsc...@googlegroups.com
Claudiu Avatamanitei created an issue
 
Jenkins / Bug JENKINS-58367
cwd set by exws set is replaced by withEnv and withCredentials steps
Issue Type: Bug Bug
Assignee: Alexandru Somai
Components: external-workspace-manager-plugin, workflow-basic-steps-plugin
Created: 2019-07-05 21:11
Environment: JENKINS_VERSION 2.176.1
external-workspace-manager 1.1.2
workflow-basic-steps 2.18
Priority: Major Major
Reporter: Claudiu Avatamanitei

Hi, 

I am experiencing an unexpected change of the current working directory when withEnv or with 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!       }

    }
  }
}

 

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

claudiu.avat@gmail.com (JIRA)

unread,
Jul 5, 2019, 5:13:02 PM7/5/19
to jenkinsc...@googlegroups.com
Claudiu Avatamanitei updated an issue
Change By: Claudiu Avatamanitei
Hi, 

I am experiencing an unexpected change of the current working directory when withEnv or
with 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!
      }

    }
  }
}

 
Reply all
Reply to author
Forward
0 new messages