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?
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.
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.
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 …
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?
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.
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:
The plugin also adds a rerun button for in the build section.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With