How do I re-run a build?

13,006

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.

Share:
13,006
Aaron Jensen
Author by

Aaron Jensen

Creator and maintainer of Carbon, the open-source PowerShell DevOps module. #SOreadytohelp

Updated on August 07, 2022

Comments

  • Aaron Jensen
    Aaron Jensen almost 2 years

    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.