Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I re-run a build?

All our Jenkins jobs are configured to build changes on all branches in a repository. There are times where we want to re-run a specific build that ran against a specific commit.

  • a build fails because some external resource was unavailable and we want to re-run that commit once the resource is up again;
  • a job depends on an internal package and we need to be able to re-build specific branches to pick up the latest version of that package.

Jenkins' "Build Now" command, however, builds on the branch of the last build. It doesn't let the user choose what branch to build on. In order to rebuild a branch, users have to commit and push a change to that branch.

Is there a plugin that will allow the user to re-run a specific build or choose the branch to build on? If you've used TeamCity, I want the "Re-run with same revisions" feature.

We've tried both the Naginator and Rebuilder plugins. Naginator only lets you rebuild failed builds, but also automatically re-builds failed builds at least once (not desireable). Rebuilder always rebuilds the last commit. It behaves just like the "Build Now" button.

like image 536
Aaron Jensen Avatar asked Nov 08 '17 20:11

Aaron Jensen


People also ask

How do I rerun failed jobs in Jenkins?

To retry a Jenkins job, you can use the Naginator plugin. 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.

How do I re run a test on github?

Re-running all the jobs in a workflow From the list of workflow runs, click the name of the run to see the workflow run summary. In the upper-right corner of the workflow, use the Re-run jobs drop-down menu, and select Re-run all jobs.


1 Answers

The Rebuild plugin is probably the closest plugin to what you want however as you have found it only will get HEAD and not a specific git revision.

This is an open feature request.

The comment on this question notes the same thing.

All that being so I would still suggest that you should perhaps reconsider the idea of depending on the git revision to drive the outcome of your build. You should want to build the HEAD.

like image 140
Andrew Gray Avatar answered Nov 21 '22 21:11

Andrew Gray