Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to re-build task on Jenkins until build succeed?

I have a Jenkins job which requires a several build attepmts until it is built successfully, is there a way to keep re-building the job automatically until the job is done?

like image 948
barha Avatar asked Jun 15 '17 14:06

barha


People also ask

How do I reset my Jenkins build history?

Go to a Job (Any type of) or a Folder and click on the "Purge Build History" link on the left menu. Select none or all of the options. Reset build number to 1: Resets the next build number 1 if all the builds are deleted.

Is it possible to keep re-building a Jenkins job automatically?

I have a Jenkins job which requires a several build attepmts until it is built successfully, is there a way to keep re-building the job automatically until the job is done? If your build is expected to require more than one attempt to succeed, I would fix the build first. To retry a Jenkins job, you can use the Naginator plugin.

How do I replay a failed Jenkins build?

If the job is a jenkins pipeline, open the failed build and select the Replay option. Otherwise select the Rebuild option. Thanks for contributing an answer to DevOps Stack Exchange! Please be sure to answer the question. Provide details and share your research! But avoid …

How to rebuild a parametrized Jenkins build without parameters?

Show activity on this post. Jenkins provide a plugin called "Rebuild plugin" after installing this plugin user allows to rebuild a parametrized build without entering the parameters again.It will also allow the user to edit the parameters before rebuilding. Is this what you are looking for?

How to control the number of continuous failure builds in Jenkins?

So, let’s use fixed period; and set it to 180 (3 minutes). This is used to control the number of continuous failure builds. Jenkins will not automatically retry more than this maximum number of consecutive failures. So, let’s set 2, so that it is retried only two times. 11. Now, run the build and see it executing two times after the failure.


1 Answers

If your build is expected to require more than one attempt to succeed, I would fix the build first.

To retry a Jenkins job, you can use the Naginator plugin.

Configuration

Simply install the plugin, and then check the Post-Build action "Retry build after failure" on your project's configuration page.

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.

The following options are also available:

  • Rerun build for unstable builds as well as failures
  • Only rebuild the job if the build's log output contains a given regular expression
  • Rerun build only for the failed parts of a matrix job

The plugin also adds a rerun button for in the build section.

like image 172
Martin Avatar answered Oct 08 '22 01:10

Martin