Gerrit 2.12.2 Setup with Github Sign in
NOTE: Would be good if you follow the guide in a root environment.
Code:
sudo -i If you want to know anything else about gerrit then head over to http://ift.tt/1xG7uvf
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 JDK 7 installed on the system.
If you do not have it installed, then:
Code:
sudo apt-get purge openjdk-\* icedtea-\* icedtea6-\* icedtea7-\* icedtea8-\*
sudo apt-get update && sudo apt-get install openjdk-7-jdk && sudo apt-get install openjdk-7-jre Code:
java -version Next download the Gerrit and Github oauth files
Tip: Use
Code:
wget <url> Gerrit (What i am using for the tutorial) : 2.12.2
Github oauth library (for 2.12.): github-oauth-2.12-SNAPSHOT.jar
Gerrit Github Plugin: github-plugin-2.12-SNAPSHOT.jar
Note: Visit here for the github plugin and lib if you have a newer gerrit version
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. Or if not, you may use an ip of the vps or something.
Section 2: Getting system ready for installation.
Add Gerrit user and group to the system
Code:
sudo useradd gerrit && groupadd gerrit Code:
mkdir lib && mkdir plugins Code:
cp /root/gerrit2.12.2.war /home/gerrit
cp /root/github-oauth-2.12-SNAPSHOT.jar /home/gerrit/lib
cp /rootgithub-plugin-2.12-SNAPSHOT.jar) /home/gerrit/plugins Code:
sudo apt-get install gitweb
sudp apt-get install gitreview Setup a new github account for example xosgerrit 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 @pjgraber03 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 gerrit directory that you created earlier.
once in the gerrit directory you will need to run the following command
Code:
sudo java -jar gerrit*.war init The 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:
http://ift.tt/HbVoOJ
Settings (assumed Gerrit URL: http://ift.tt/1K2hLlG)
* 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 gerrit2 Starting gerrit
Once back inside /home/gerrit2
run....
Code:
sudo bin/gerrit.sh start To stop gerrit or restart gerrit the commands are...
Code:
sudo bin/gerrit.sh stop
or
sudo bin/gerrit.sh restart If you run into a FAILED when starting up gerrit you can run
Code:
nano logs/error_log One 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.pub http://ift.tt/1xG7uvf
http://ift.tt/WQ50tD
http://ift.tt/1i9J1B0
http://ift.tt/24r7Y91
Huge credits to @pjgraber03 for putting this all up!
Thanks. I just amended stuff for the newest version.
from xda-developers http://ift.tt/1ZdipGq
via IFTTT
Aucun commentaire:
Enregistrer un commentaire