From 84cd38f97d8f60035b6a9918191447fa6117c0b3 Mon Sep 17 00:00:00 2001 From: Scott Chacon Date: Thu, 12 Jun 2014 11:52:00 -0700 Subject: [PATCH] start of gerrit --- book/04-git-server/1-git-server.asc | 38 ++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/book/04-git-server/1-git-server.asc b/book/04-git-server/1-git-server.asc index 12434383f..a1c854bfd 100644 --- a/book/04-git-server/1-git-server.asc +++ b/book/04-git-server/1-git-server.asc @@ -821,7 +821,43 @@ One benefit to GitLab is that, once the server is set up and running, you'll rar === Gerrit -TODO: Gerrit +==== Installing Gerrit + +First, install Gerrit. It's actually really simple to do so. You download the latest war file from the Gerrit website and run it. This initializes the project and starts a web server on port `8080` by default. + +[source,script] +---- +$ wget https://gerrit-releases.storage.googleapis.com/gerrit-2.8.5.war +$ java -jar gerrit.war init --batch -d ~/gerrit_testsite +Generating SSH host key ... rsa(simple)... done +Initialized /home/gerrit2/gerrit +Executing /home/gerrit2/gerrit/bin/gerrit.sh start +Starting Gerrit Code Review: OK +---- + +Now you can go to `http://gitserver:8080` (or whatever your server name is) and see Gerrit running. + +The server will ask you to log in via OpenID and the first user to do so will become an Administrator. As part of the user registration process, Gerrit will ask you for your SSH public key. This is mandatory to use Git with Gerrit, so be aware that all of your users will need to generate and upload SSH keys. + +Once you're registered, you can test to see if you have a valid account by SSHing into the server. Gerrit by default will open it's SSH server on a nonstandard port of `29418`. + +[source,script] +---- +$ ssh schacon@git.example.com -p 29418 + + **** Welcome to Gerrit Code Review **** + + Hi Scott Chacon, you have successfully connected over SSH. + + Unfortunately, interactive shells are disabled. + To clone a hosted Git repository, use: + + git clone ssh://schacon@git.example.com:29418/REPOSITORY_NAME.git + +Connection to git.example.com closed. +---- + +Great, so we now have a working Gerrit web and SSH server and an active account. You should be able to simply point the rest of your team to the server and let them sign themselves up. === Third Party Hosted Options