one downstream with multiple upstreams(all upstreams should be success)

25 views
Skip to first unread message

chenna keshav

unread,
Sep 1, 2020, 2:52:49 PM9/1/20
to Jenkins Users
Hi,

i have stuck with a small issue... i have a job A which triggers job B and job C. for job B and job C downstream job is job D.... i need this job D is to be triggered when job B and job C both are success. i have tried with "Build after other projects are build" with "trigger only if build is stable" option. its not working for me... the job is getting triggered even one of jobs is success. can some one please help me on this..........

Thanks,
Keshav.

Gianluca

unread,
Sep 1, 2020, 3:55:50 PM9/1/20
to Jenkins Users
Hi,
why not triggering Job D directly from job A ? In this way, if you put that in a stage after job B and job C is triggered ... it will only be triggered if both succedded:

stage("Run B and C") {
  steps {
    parallel(
      "job B": { buildJob ... },
      "job C:" { build Job ... },
}

stage("Run D") {
  steps {
   // this will run only if both Job B and C succeed
    buildJob
  }
}

Cheers,
Gianluca.

chenna kesavulu

unread,
Sep 1, 2020, 4:23:44 PM9/1/20
to jenkins...@googlegroups.com
Hi Gianluca,

I can't trigger Job D directly from Job A. Actually in my project we are running integration tests in Job B and UI tests in Job C. So if both the builds are green then only  i can merge the code to master in Job D. But thanks for your answer I will try it.

Thanks,
Keshav.
  

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/d4839902-97c8-4eb5-baa2-a080a400cfdbn%40googlegroups.com.

Reinhold Füreder

unread,
Sep 2, 2020, 2:30:10 AM9/2/20
to jenkins...@googlegroups.com

Hi Keshav,

 

sorry for interfering, but I think Gianluca’s pseudo code and hint should actually help you:

  • Job A will wait for both job B and job C to be finished
  • and only if both were successful, then and only then continue with triggering job D in the next stage

 

HTH Reinhold

Ven H

unread,
Sep 2, 2020, 4:57:33 AM9/2/20
to jenkins...@googlegroups.com
Hi,

How about using "wait" and "propagate" attributes on build step? Can you check if these help in your case?

Regards,
Venkatesh


Reply all
Reply to author
Forward
0 new messages