This plugin integrates Hudson to Gerrit code review for triggering builds when a "patch set" is created.
The source code is available on GitHub .
Specify the Gerrit server settings via "Manage Hudson > Gerrit Hudson Trigger"
Fill in the server settings:
Click "Test Connection" to verify the connection.
When everything seems ok, save your settings and restart the connection in the "Control" section at the bottom of the page:
There are many more settings for your pleasure, look at the individual help sections for information what they are about.
In the "Build Triggers" section of your Job configuration page; tick "Gerrit event":
Specify what Gerrit project(s) to trigger a build on.
At least one project and branch pattern needs to be specified for a build to be triggered,and you can specify as many gerrit project to trigger on as you want.
Start by specifying the name of the Gerrit project in the left hand text field.
You can specify the name pattern in three different ways, as provided by the "Type" drop-down menu.
- Plain: The exact name in Gerrit, case sensitive equality.
- Path: ANT style pattern. Ex: "*/base/**"
- RegExp: Regular expression.
Then provide the name of the branch(es) to trigger on. The same "pattern types" is available as above.
So for example to trigger on all branches in the project you can specify:
You can add more branch patterns by clicking on "Add Branch" and more projects by clicking "Add Project".
Usage with the Git Plugin
To get the Git Plugin to download your change; set Refspec to $GERRIT_REFSPEC and the Choosing strategy to Gerrit Hudson Trigger.
Usage with Repo
If you are using a freestyle project and repo to download your code it would be as "easy" as.
repo init -u git:repo sync
repo download $GERRIT_PROJECT $GERRIT_CHANGE_NUMBER/$GERRIT_PATCHSET_NUMBER
Version 2.2.0 (released Oct 7, 2010)
- Allow for searching and manual triggering of Gerrit Patches - the feature requires Gerrit version 2.1.4 or later, but can be disabled.
- Known bug: when upgrading from previous release, the manual trigger page is disabled by default. Goto the Gerrit Management page and enable it under the advanced section.
- Gerrit/GIT Project-name Autocompletion on trigger-config page.
- Multiple build's results are reported on separate lines to Gerrit instead of "tab separated".
- Approve commands are queued on a separate thread-pool instead of running on the last build's thread.
Version 2.1.0 (released July 26, 2010)
- HUDSON-6818 Retrigger builds. The users has the ability to retrigger a build. A new build with the same change info as the original build will be scheduled.
- HUDSON-6967 Missing default parameters.
- HUDSON-6977 Images and help don't load when Hudson isn't running on the root URL.
- Fixed some Leaking threads
- Japanese translation
Version 2.0 (released July 5, 2010)