0

I have 3 pre job defined in Jenkins file that i want to run in sequence . Like test1 should execute after test job is completed and test2 should execute after test1 is completed

Currently i read this job in while loop and will trigger in parallel and it works fine

in scripted pipeline how can i check the status of the job and wait for it until that job is completed so basically i will need to keep on polling the status of the 1st job and move to 2nd job when 1st one is completed

"preDeployJobs" : {
            "devl" : [
                
                ["Deploy/test_prejob:[parameters: [string(name: 'BUILD_ID_PARAM', value:'%UCD_BUILD_DISPLAY_NAME%')]]"],
                ["Deploy/test1_prejob:[parameters: [string(name: 'BUILD_ID_PARAM', value:'%UCD_BUILD_DISPLAY_NAME%')]]"],
                ["Deploy/test2_prejob:[parameters: [string(name: 'BUILD_ID_PARAM', value:'%UCD_BUILD_DISPLAY_NAME%')]]"]
           ]
    }
ycr
  • 12,828
  • 2
  • 25
  • 45
Sagar Shah
  • 37
  • 1
  • 1
  • 9
  • Can you add the Job execution part of the Pipeline? – ycr Oct 26 '22 at 23:44
  • So this one worked for me wait:true . it will wait for the 1st job to complete before job2 is picked up example: def myjob=build job: 'componentB', propagate: true, wait: true – Sagar Shah Oct 27 '22 at 17:58

0 Answers0