Gerrit 2.11 Setup with Github Sign in
So What is Gerrit?
Quote:
|
Gerrit is a free, web-based team code collaboration tool. Software developers in a team can review each other's modifications on their source code using a Web browser and approve or reject those changes. It integrates closely with Git, a distributed version control system. I assume that if you are reading this then you are already convinced of the benefits of code review in general but want some technical support to make it easy. Code reviews mean different things to different people. To some it is a formal meeting with a projector and an entire team going through the code line by line. To others it is getting someone to glance over the code before it is committed. Gerrit is intended to provide a light weight framework for reviewing every commit before it is accepted into the code base. Changes are uploaded to Gerrit but do nott actually become a part of the project until they have been reviewed and accepted. |
So lets jump right into setting up gerrit.
1. Getting together everything you need.
2. Getting system ready for installation.
3. Putting together everything and installing gerrit
Section 1: Getting together everything needed
First of you need to make sure have java installed on the system.
if you do not have java installed then go HERE
Next download the Gerrit 2.11 files
File 1: Gerrit-2.11.war
File 2: Github-oauth-2.11.jar
File 3: Github-plugin-2.11.jar
Last BUT MOST IMPORTANT
Make sure that you have registered a website domain (like with godaddy.com). Make sure the your dns zone file points your URL to the IP of the machine or server you will be using for gerrit.
Section 2: Getting system ready for installation.
Add Gerrit2 user and group to the system
Code:
sudo useradd gerrit2 && groupadd gerrit2Code:
mkdir lib && mkdir pluginsCode:
mv /download/location/gerrit2.11.war /home/gerrit2
mv /download/location/github-oauth-2.11.jar /home/gerrit2/lib
mv /download/location/github-plugin-2.11.jar /home/gerrit2/pluginsCode:
sudo apt-get install gitweb
sudp apt-get install gitreviewsetup a new github account for example fubargerrit as a github account
once you are signed into gerrit under your new Github account go into settings.
if your setting up for team use be sure to add new github account to the team organization!!!!
next click on the applications...If your doing team click on the organization then on application.
Put in your url to your new gerrit site that you setup in the begining.
If you need visual support for this step I have a couple pictures
Picture 1
Picuture 2
Section 3: Putting together everything and installing Gerrit
Now you should have everything together that you need to get gerrit up and running.
Initiating Gerrit for this first time
you will need to change into the gerrit2 directory that you created earlier.
once in the gerrit2 directory you will need to run the following command
Code:
sudo java -jar gerrit-2.11.war initThe following are just my options....You may wish to change at some point
Code:
*** Gerrit Code Review 2.11
***
*** Git Repositories
***
Location of Git repositories [git]:
*** SQL Database
***
Database server type [h2]:
*** Index
***
Type [LUCENE/?]:
*** User Authentication
***
Authentication method [HTTP/?]:
Get username from custom HTTP header [Y/n]?
Username HTTP header [GITHUB_USER]:
SSO logout URL :
*** Email Delivery
***
SMTP server hostname [localhost]:
SMTP server port [(default)]:
SMTP encryption [NONE/?]:
SMTP username :
*** Container Process
***
Run as [gerrit2]:
Java runtime [/usr/lib/jvm/java-7-openjdk-amd64/jre]:
Upgrade /home/gerrit2/bin/gerrit.war [Y/n]?
Copying gerrit-2.11.war to /home/gerrit2/bin/gerrit.war
*** SSH Daemon
***
Listen on address[*]:
Listen on port [29418]:
*** HTTP Daemon
***
Behind reverse proxy [y/N]?
Use SSL (https://) [y/N]?
Listen on address[*]:
Listen on port [8081]:
Canonical URL [http://]: enter your url HERE
*** Plugins
***
Installing plugins.
Install plugin download-commands version v2.11 [y/N]? Say Y
Install plugin reviewnotes version v2.11 [y/N]? say Y
Install plugin singleusergroup version v2.11 [y/N]? say Y
Install plugin replication version v2.11 [y/N]? say Y
Install plugin commit-message-length-validator version v2.11 [y/N]? say Y
Initializing plugins.
*** GitHub Integration
***
GitHub URL [https://github.com]:
GitHub API URL [https://api.github.com]:
NOTE: You might need to configure a proxy using http.proxy if you run Gerrit behind a firewall.
*** GitHub OAuth registration and credentials
***
Register Gerrit as GitHub application on:
https://github.com/settings/applications/new
Settings (assumed Gerrit URL: http://review.blissroms.com)
* Application name: Gerrit Code Review
* Homepage URL: http://yoururl.com
* Authorization callback URL: http://yoururl.com
After registration is complete, enter the generated OAuth credentials:
GitHub Client ID (This is where you will enter the client ID you got from github
GitHub Client Secret (Enter the secret you got from github)cd in /home and run
Code:
sudo chown -R gerrit2:gerrit2 gerrit2Starting gerrit
Once back inside /home/gerrit2
run....
Code:
sudo bin/gerrit.sh startTo stop gerrit or restart gerrit the commands are...
Code:
sudo bin/gerrit.sh stop
or
sudo bin/gerrit.sh restartIf you run into a FAILED when starting up gerrit you can run
Code:
nano logs/error_logOne you get a OK when starting gerrit
go ahead and open you browser and type in your URL.
Setting up Gerrit WebUI
First thing is you need to sign in via github to your gerrit using the gerrit github user that you made in the beginning.
once you do that you need to go to your system and go to the /home/gerrit2 directory and run this
Code:
sudo su gerrit2
ssh-keygen ( just click enter till its done)
cat .ssh/id_rsa.pubhttp://gerrit-review.googlesource.com/Documentation/
https://www.packtpub.com/books/conte...-gerrit-github
http://www.vogella.com/tutorials/Gerrit/article.html
https://gerrit.googlecode.com/svn/do...er-upload.html
XDA:DevDB Information
[GUIDE][GERRIT] Installation and configuration Gerrit v2.11 with GitHub Sign in, Tool/Utility for all devices (see above for details)
Contributors
pjgraber03
Version Information
Status: Stable
Created 2015-07-20
Last Updated 2015-07-19