0

Hi all i created build pipeline using downstream parameter build. For example,

enter image description here

In above example there is three pipeline Job-1 => Job-A => Job-B => Job-C Job-2 => Job-A => Job-B => Job-C Job-3 => Job-A => Job-B => Job-C

In that Job-1, Job-2, Job-3 jobs are on same level and all have same downstream jobs like Job-A => Job-B => Job-C.

For the above example suppose flow for Job-1 is already in progress and currently executing Job-C in pipeline. At the same time suppose Job-3 is completed and it will try to trigger Job-A it should wait for completion of Job-C which is of the previous pipeline i.e. for Job-1. After completion of Job-C it will trigger Job-A for Job-3 pipeline. And it will continue for Job-2.

What should i do for same in my case. Hope you understand.

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
  • It was a bit hard to understand your exampel, would it be possible to clarify? – MaTePe Nov 30 '16 at 12:53
  • Here is similar problem with good solution: http://stackoverflow.com/questions/9012310/how-do-i-make-a-jenkins-job-start-after-multiple-simultaneous-upstream-jobs-succ – Arvid Dec 01 '16 at 09:08

1 Answers1

0

Maybe I'm still not getting it. But if it is as you say, that 1,2,3 should always trigger and complete A->B-->C.

You could create one pipeline for each 1,2,3 and one pipeline for A+B+C (called ABC). So 1,2,3 will all call the ABC job, which you can throttle, only allow one to be run at a time (do not allow concurrent execution).

MaTePe
  • 936
  • 1
  • 6
  • 11
  • In my case 1, 2, 3 ...n is independent jobs which will trigger at manually or using scm. Not always trigger at one time. but each job have downstream as A->B-->C and this is common jobs. So i want to i want to run my 1, 2, 3 .. n – Bhushan Phalak Dec 01 '16 at 11:58
  • Ok, think my suggest is the same. Group ABC into one pipeline or build_flow and trigger that job from 1,2,3...n. – MaTePe Dec 01 '16 at 11:59
  • In my case 1, 2, 3 ...n is independent jobs which will trigger at manually or using scm. Not always trigger at one time. but each job have downstream as A->B-->C and this is common jobs. So i want to run my 1, 2, 3 .. n jobs independently. If in any case two jobs will trigger at one time and job-1 complete the it will execute complete pipeline first. And second job will also complete build only but waiting to trigger his pipeline if job-1 not completed A->B->C pipeline. – Bhushan Phalak Dec 01 '16 at 12:06
  • Well, I must be missing your point. The answer is the same. Since you only can have on ABC running at a time, you will get the behavior you want if you do it as I suggested. – MaTePe Dec 01 '16 at 12:13