Pipeline customWorkspace not obeyed in docker agent when reuseNode is true

This issue is archived. You can view it, but you can't modify it. Learn more

    • Type: Bug
    • Resolution: Duplicate
    • Priority: Minor
    • Environment:

      When you use the 'customWorkspace' declarative Pipeline option in a docker agent, it is working correctly. (see attachedĀ Jenkinsfile.passĀ log.passĀ )

      The problem I'm encountering is if you also add the 'reuseNode true' option for that docker agent, then the 'customWorkspace' option is no longer obeyed. (seeĀ Jenkinsfile.failĀ log.failĀ )

      What happens is the stage runs in the same workspace as the previous stage (/Users/rkivisto/.jenkins/workspace/pipeline) which was not even run on the same agent (the first stage was run on the Master, the second stage is running in a container)

      You can see the error from the "sh 'pwd'" in the second stage, I would have expected both of these to be in '/Users/rkivisto/.jenkins/test', since the first stage was not run in the same agent as the second stage:

      diff log.pass log.fail
      ...
      < /Users/rkivisto/.jenkins/test

      > /Users/rkivisto/.jenkins/workspace/pipeline

        1. Jenkinsfile.fail
          0.4 kB
          Ray Kivisto
        2. Jenkinsfile.pass
          0.4 kB
          Ray Kivisto
        3. log.fail
          2 kB
          Ray Kivisto
        4. log.pass
          2 kB
          Ray Kivisto

            Assignee:
            Andrew Bayer
            Reporter:
            Ray Kivisto
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Resolved:
              Archived: