The plugin is not maintained anymore, and there's a better alternative: Gerrit Trigger.
You might want to check Gerrit Trigger also. See http://hudson.361315.n4.nabble.com/We-would-like-to-contribute-a-new-Gerrit-plugin-td2224606.html#a2224606 for information about main differences.
This plugin integrates Gerrit Code Review to Jenkins.
It will mark a change verified if the build of the change was successful, effectively implementing a pre-tested commit workflow with Gerrit and the Git plugin (0.8.2 or later)
After build, the plugin just checks what revision is in workspace at the moment and uses Gerrits ssh command line tools for marking the result.
Using the latest release of the Gerrit plugin, along with recent builds of Gerrit itself are recommended. Thanks to a recent addition to Gerrit, one can now create "role accounts" such as one for the Jenkins <-> Gerrit integration.
- Generate an SSH key for the Jenkins user, the private key will need to be placed on the Jenkins master node.
- Create a "hudson" user in Gerrit:
cat hudson.pub | ssh gerrithost gerrit create-account --ssh-key - --full-name Hudson hudson
- I recommend creating a group specifically for role accounts (such as "Bots" in the Admin > Groups interface in Gerrit)
- It is also useful to set up git-daemon(1) on the machine running Gerrit to allow your Jenkins slaves anonymous access to the repository, otherwise you'll need to set up all the slaves that will be running your Gerrit-enabled jobs with SSH access.
Creating the Job
- Create a new job, adding your Git repository. Change the Refspec field to reference
:refs/remotes/origin/*. Also, make sure you have chosen the "Gerrit-Plugin" choosing strategy, NOT "Gerrit" as in the image below (Choosing strategy was moved from Git-plugin to Gerrit-plugin and the name haed to be changed).
- Add your build steps as per usual
- Check the "Gerrit Integration" checkbox in the Post-build Actions section.
- Once you're certain your job is configured correctly, visit Gerrit and grant the "hudson" account's group (i.e. "Bots") "+1 Verified" access to all projects, so it can annotate the changes with +1 or -1.
- Added possibility to set Review values. If review or verify value is 0, it won't show up in Gerrit. Idea for this came from http://groups.google.com/group/repo-discuss/msg/354c62365a472e33
- Aborted builds won't be marked as failed anymore
- Moved buildchooser from git-plugin, use "Gerrit-Plugin" choosing strategy from now on.
- Fix for issue when using Cygwin+Git.
- Fixed issue when using slaves for build
- SSH commands are now sent from master only.
- Internal restructuring
- Added some unit tests
- This version will lose settings when upgrading from 0.2*
- Close ssh connection to gerrit properly
- Added configuration option for unstable build verify value.
- Failed release process forced to do a new release
- Initial version
- Perhaps add possibility to set review values also, for example when code analysis tools report errors. Analysis Collector Plugin might be useful.
Basic settings for plugin, remember to add user into gerrit.
Settings for Git -plugin (Available in 0.8.2)
How Jenkins shows up in gerrit