0

How can I get the Build workspace for a inside job. I have a pipeline which builds jobs in the following:

node('TEST_UST') {
    stage('test01') {
        build job: 'test01'
    }
    stage('test02') {
        build job: 'test02'
    }
}

How Could I get the workspace of job test01?

yong
  • 13,357
  • 1
  • 16
  • 27
Amber
  • 1
  • 1
    Hi Amber, welcome to SO. Your question is a bit unclear. What you would like to achieve here? What is the "Build workspace"? If you would like just to check the results of the 'test01' or 'test02' job you could look up the return values for the build steps, more on it here - https://stackoverflow.com/questions/39539613/return-parameters-results-from-a-jobtriggered-by-pipeline-back-to-the-same-pip – hakamairi Dec 19 '18 at 12:17
  • For example: My job test01 is run on the workspace /home/test1, the job test02 is run based on the workspace /home/test2, how could I get the workspace /home/test1 ? – Amber Dec 20 '18 at 09:59
  • So normally you would have to share the workspace, ways to do that are mentioned here: https://stackoverflow.com/questions/21520475/same-workspace-for-multiple-jobs I still don't get why do you want this workspace access? Job results can be accessed from return value of the build step, artifacts should be normally published somewhere. There's also a way to get some custom variable values returned, why do you need workspace access? – hakamairi Dec 21 '18 at 12:42

0 Answers0