Gerrit
m |
(→Custom package: Minor tweak. Need to run init.) |
||
| Line 46: | Line 46: | ||
mvn package -Dgerrit.include-documentation=1 -Dgwt.style=pretty | mvn package -Dgerrit.include-documentation=1 -Dgwt.style=pretty | ||
| − | + | To replace the live version: | |
| + | service gerrit stop | ||
| + | java -jar <custom war> init -d /var/lib/gerrit2/review_site --batch | ||
| + | service gerrit start | ||
== Creating new repositories == | == Creating new repositories == | ||
Revision as of 13:12, 31 October 2012
We use Gerrit for our code review system for Git. It supersedes the CodeReview extension.
Contents |
Quick links
Details
Gerrit is installed on manganese in the prefix /var/lib/gerrit2.
It is a Java daemon which listens for HTTP connections (port 8080) and SSH connections (port 29418). Apache on manganese proxies the relevant URLs on port 80 and 443 through to Gerrit. The SSH port provides a restricted shell for Git checkouts and administrative commands.
It uses the misc DB server (db9/db10), database name "reviewdb", for most storage.
It uses the LDAP instance shared with subversion and labs, possibly on virt0.wikimedia.org, for authentication. Accounts under ou=people,dc=wikimedia,dc=org and groups under ou=groups,dc=wikimedia,dc=org are exposed to Gerrit. The Gerrit account name is the "cn" field in LDAP. In order to log in to Gerrit, a user needs to already have a Labs account. See "Help:Access" on the Labsconsole wiki for the process of getting a Labs account.
Gerrit shells out to GitWeb, a Perl application which is installed using the stock package.
To find out what version of Gerrit is running, you can use:
java -jar /var/lib/gerrit2/gerrit.war version
It is 2.4.2 at the time of writing.
Using git
This is documented on the labsconsole wiki and on mediawiki.org.
Upgrading Gerrit
- Back up the database (db9.reviewdb) and git directories (/var/lib/gerrit2/review_site/git/). Just In Case.
- Download the latest .war file from Google Code to /var/lib/gerrit2/.
- Stop the gerrit daemon (/var/lib/gerrit2/review_site/bin/gerrit.sh stop)
- Start gerrit with the new *.war file using the "init" flag. For example: cd /var/lib/gerrit2 && java -jar gerrit-2.3.war init -d review_site
- The updater is going to ask you some questions, keep the current values. When it asks you if you want to copy the *.war file to the bin directory, say yes.
- Profit!!
Note: You may need to restart gerrit after the upgrade is finished.
Custom package
We maintain our own fork of Gerrit which is hosted ... in Gerrit! You will have to clone gerrit.wikimedia.org/operations/gerrit -b stable-2.4-wmf. The branch is a fork of upstream stable-2.4 with our custom patches piled on top.
To build the war:
mvn package -Dgerrit.include-documentation=1 -Dgwt.style=pretty
To replace the live version:
service gerrit stop java -jar <custom war> init -d /var/lib/gerrit2/review_site --batch service gerrit start
Creating new repositories
see mw:Git/Creating new repositories