tiistai 27. lokakuuta 2009

Integrating Gerrit and Hudson

Some ideas about integrating Gerrit, Hudson and Git we've figured out at work.

Gerrit (http://code.google.com/p/gerrit/) is a code review tool used by the Android project. It has been developed for using with Git (http://git-scm.com/) source control management system. Hudson (http://hudson-ci.org/) is a continuous integration server. How these two can be integrated?

Basic idea in integration of Gerrit and Hudson is to think Hudson as a reviewer in Gerrit. When using Gerrit, developer uploads his/hers changed to Gerrit's magic branches. These changesets can then be pulled from Gerrit, and this is what Hudson does. It will pull every changeset from Gerrit and run automated tests against them. If tests are successful, Hudson uses Gerrit's command line tools to approve the changeset. This can be done as a final build step in Hudson. After this, it is up to human reviewers to make final decision about approval of the changeset.

After changeset is approved and merged to main repository, Hudson will pull the changeset and performs deployment to test environment.