We are using the build flow plugin to run our Jenkins builds and our builds are triggered with the gerrit plugin. We have a situation where our branches are periodically locked down (for an unknown amount of time) and we need to retrigger these builds.
While the builds can be easily retriggered from the UI, I was wondering if someone knew/could guide me in how to retrigger the build using the jenkins command line. From what I can tell, you can launch a build from the command line, but I don't really see an option on how to launch it from the command line and use a gerrit change set to launch the build. Has anyone done this? I don't want to manually retrigger the builds because in some cases there could be hundreds of builds to retrigger. I also can get the list of builds directly from gerrit that need to be retriggered, eliminating the potential for a rerun of an older changeset.
I have tried using the naginator plugin, however it re-executes the build at a given interval for a given set of time. The problem is that I have an unknown period of time where this lockdown is taking place on a branch.
My plan is currently set up to write a script to capture the build job failures based off the locked branches. From there, once the announcement comes out that the branch is unlocked, I'd like to take the jenkins command line and retrigger only those builds that have failed.
Does anyone have a better suggestion, or is anyone retriggering a jenkins build using gerrit that can point me in the right direction?
Thanks!
Katie