You are here

Installing and configuring Gerrit Code Review System

Table of Contents

  • General Information
  • Requirements
  • Installation of Gerrit under FreeBSD
  • Installation of Gerrit under Debian GNU/Linux
  • Starting/stopping and initial configuration of Gerrit

General Information

In this handbook we we will see how to install and do the initial configuration of Gerrit - a code review and project management system for Git based project.

So, what is Gerrit?

Quoting from the official web page of Gerrit:

"Gerrit is a web based code review system, facilitating online code reviews for projects using the Git version control system.

Gerrit makes reviews easier by showing changes in a side-by-side display, and allowing inline comments to be added by any reviewer.

Gerrit simplifies Git based project maintainership by permitting any authorized user to submit changes to the master Git repository, rather than requiring all approved changes to be merged in by hand by the project maintainer. This functionality enables a more centralized usage of Git."

In this handbook we will see how to install and configure Gerrit under FreeBSD and also Debian GNU/Linux

Currently there are no official Gerrit packages for FreeBSD and Debian GNU/Linux at the moment of writing this handbook, so I've ported Gerrit to both systems and the port/package can be found in my Github projects.

If you are willing to submit these packages as official FreeBSD/Debian packages, please feel free to do so :)

Requirements

  • root access or sudo rights

Tested And Verified

  • FreeBSD 9.0 system
  • Debian GNU/Linux 6.0 system
  • Gerrit 2.4.2

Installation of Gerrit under FreeBSD

In order to install Gerrit under FreeBSD we are going to use the gerrit-freebsd port from Github.

NOTE: There is already a PR for adding Gerrit to the FreeBSD Ports collection, so until Gerrit goes into the Ports Tree, please use the instructions provided below. Once Gerrit has been added to the Ports Tree install it as you would with any other port. See ports/163655 for more information.

So, first clone the Gerrit Git repository:

$ git clone https://github.com/dnaeon/gerrit-freebsd.git

Before we install Gerrit we also need a dedicated user for Gerrit. In order to create the Gerrit user, we need to patch our ports/UIDs and ports/GIDs first.

NOTE: Once ports/163666 gets commited and Gerrit is added to the Ports Tree, you will not have to patch the files manually, but this will be already set for you.

Download the patch from ports/163666 and then apply it:

$ cd /usr/ports && sudo patch < /path/to/patch.txt

This should add entries for the Gerrit user and group, which in turn will be used by the Gerrit Port during installation.

Now, lets build the Gerrit port:

$ cd gerrit-freebsd && sudo make install clean

Once Gerrit is installed lets enable it in /etc/rc.conf, so that Gerrit is also started during boot-time. To do that add this line to your /etc/rc.conf file:

gerrit_enable="YES"

In the next sections of the handbook we will see how to start/stop our Gerrit instance and how to do the initial configuration of Gerrit.