Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run a Jenkins build only if another build has been successful?

Tags:

jenkins

I want Jenkins to run a regularly scheduled build A only if another regularly scheduled build B has been successful. If the build A has failed the this way dependent build B should not run (since it would fail also). I don't want to trigger B from A directly since B as a completely other schedule (runs more infrequently).

like image 309
Strinder Avatar asked Feb 20 '12 10:02

Strinder


People also ask

How do you run the job in Jenkins after successful execution of the another job?

You can follow the below steps to trigger a Jenkins pipeline in another Jenkins pipeline. Select a job that triggers a remote one and then go to Job Configuration > Build section > Add Build Step > Trigger builds on remote/local projects option.

How do I run concurrent builds in Jenkins?

Jenkins allows for parallel execution of builds for a Job. Job configuration page has a check box, "Execute concurrent builds if necessary". Also, in the master node configuration set the "# of executors" field to more than 1. Once these two are done, parallel job execution is enabled.

What is the meaning of * * * * * In the schedule text box of the build trigger section?

In the Build Triggers section, instead of selecting Build Periodically, let's select Poll SCM. As soon as we do that, we should see a text box with Label Schedule. Let's type */5 * * * * in this box, which means we want to schedule the job to run every 5 minutes: Let's scroll up to Source Code Management section.


1 Answers

Try BuildResultTrigger Plugin - you can set it in job B to poll the results of job A with the desired (un)frequency.

like image 144
malenkiy_scot Avatar answered Sep 16 '22 22:09

malenkiy_scot