Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to trigger a job, If the currently running job failed?

In my task I need to trigger a same job if its current build failed. I don't want the trigger if the build got succeeded.

Is there any plugins or any other method available to do this task?

like image 809
mahinlma Avatar asked Aug 07 '15 05:08

mahinlma


2 Answers

You can use Downstream Ext Plugin for this:

enter image description here

my_project will be triggered only if this build fails.

Note: if you want to trigger the same job, you should realize that this is a chance to have an infinitive loop. If the build always fails, it will be triggered over and over again...

like image 97
Vitalii Elenhaupt Avatar answered Oct 21 '22 17:10

Vitalii Elenhaupt


The best solution is to use Naginator Plugin.

If the build fails, it will be rescheduled to run again after the time you specified. You can choose how many times to retry running the job. For each consecutive unsuccessful build, you can choose to extend the waiting period.

like image 21
mainframer Avatar answered Oct 21 '22 17:10

mainframer