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

PWD returning wrong path

XMLWordPrintable

      Since updating https://plugins.jenkins.io/workflow-durable-task-step/ to version: 1206.v8a_d5f86e336b, some of our jobs have been broken. We boiled it down to seemingly the wrong paths being set due to nodes.
      The following pipeline returns a folder on the node ElMo despite being preceeded by the "node('master')"
      This does not happen if we remove the "customWorkspace 'workspace/node_workspace'"  but we would like to still use this path.
      Before the update, pwd() in the post step would return a path on the master node.

      #!groovy
      pipeline
      {
          agent
          {
              node{
                  label 'ElMo'
                  customWorkspace 'workspace/node_workspace'
              }
          }
          stages
          {
              stage('stuff to do on worker node')
              {
                  steps
                  {
                      script
                      {
                          echo 'test'
                      }
                  }
              }
          }
          post
          {
              always
              {
                  node('master')
                  {
                      script
                      {
                          print 'current folder pwd(): '+pwd()
                      }
                  }
              }
          }
      }
        

            jglick Jesse Glick
            paul_lubos Paul
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: