- 追加された行はこの色です。
- 削除された行はこの色です。
#topicpath
//////////////////////////////////////////////////////////////////////////////
* 目次 [#r9489306]
#contents();
//////////////////////////////////////////////////////////////////////////////
* インストールと設定 [#vbe202f4]
//============================================================================
** ユーザ <gerrit-user> を作成 [#kb13275f]
- adduser でユーザ <gerrit-user> (実際に作成したユーザ名は"gerrit")を作成
- <gerrit-user> の ${HOME} (= /home/<gerrit-user>) を、 <gerrit-group> グループに対して rwx を許可する。
# chmod g+rwx /home/<gerrit-user>
$ ls -l /home/
合計 12
drwxrwxr-x 3 gerrit gerrit 88 8月 28 08:40 gerrit
//============================================================================
** DB [#y37550cd]
- ここでは PostgreSQL を選択した。
# apt-get install postgresql postgresql-contrib
//----------------------------------------------------------------------------
*** PostgreSQL の設定 [#b508915c]
- ユーザ "postgres" になる(See also: [[sudo>Security/sudo]])
$ sudo -i -u postgres
- そこから更に Postgres prompt を呼び出すのに、以下をタイプする:
$ psql
postgres@localhost:~$
- Postgres prompt から抜けるには、以下をタイプする:
postgres@localhost:~$ \q
- role の新規作成
postgres@localhost:~$ createuser --username=postgres -RDIElPS <gerrit-user>
postgres@localhost:~$ createdb --username=postgres -E UTF-8 -l ja_JP.UTF8 -T template0 -O <gerrit-user> reviewdb
//============================================================================
** Gerrit の DL/Install [#a07c2055]
- /etc/apt/sources.list.d に Gerrit のエントリを追加する
# echo "deb mirror://mirrorlist.gerritforge.com/deb gerrit contrib" > /etc/apt/sources.list.d/gerritforge.list
- GPG key を追加
# apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 1871F775
- 取得
# aptitude update
# aptitude install gerrit
//----------------------------------------------------------------------------
*** Gerrit の設定編集 [#t22c2363]
- Gerrit の設定は /var/gerrit/etc/gerrit.config にある。
- /var/gerrit/etc/gerrit.config を以下のように変更する:
# diff gerrit.config gerrit.config.orig
3c3
< canonicalWebUrl = http://<your-host-name>/gerrit
---
> canonicalWebUrl = http://<your-host-name>:8080/
16c16
< listenUrl = proxy-http://127.0.0.1:8080/gerrit
---
> listenUrl = http://*:8080/
- 設定を変更したら、 Gerrit を再起動する。下記のように "OK" が出れば再起動成功。
# /etc/init.d/gerrit restart
Stopping Gerrit Code Review: OK
Starting Gerrit Code Review: OK
//============================================================================
** apache2 [#c3b4ed56]
- /etc/apache2/sites-enabled/000-default.conf を以下のように修正する
# diff -u 000-default.conf 000-default.conf.orig
--- 000-default.conf
+++ 000-default.conf.orig
@@ -26,8 +26,6 @@
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
-
- AllowEncodedSlashes On
</VirtualHost>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
- apache2 を再起動する
# /etc/init.d/apache2 restart
Restarting apache2 (via systemctl): apache2.service.
//////////////////////////////////////////////////////////////////////////////
* Gerrit を使う [#yf624a94]
- 上記設定を行った後、ブラウザでアクセスする
http://<your-host-name>:8080/gerrit
//////////////////////////////////////////////////////////////////////////////
* 参考リンク [#x594e543]
- [[Ubuntu ServerにGerritをインストールする >http://ameblo.jp/dumbobambino/entry-11938447999.html]]
-- 最終的に参考にしたのはこれ。
- [[Gerrit Code Review - Standalone Daemon Installation Guide>https://gerrit-documentation.storage.googleapis.com/Documentation/2.9.1/install.html#cryptography]]
- [[Gerrit + Jenkins StartUp: Gerrit + Jenkins StartUp- Install Gerrit>http://beta.mybetabook.com/showpage/4f56073e0cf2f3f0a3dd1876]]
-- 説明が分かりやすい。しかし情報が古くなっているのか、wget する URI などは既に存在しなくなっている。
- [[Narrow Escape gerritのインストール方法>http://www.hiroom2.com/2015/08/23/gerrit%E3%81%AE%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB%E6%96%B9%E6%B3%95/]]
-- Debian8 に Ubuntu package をインストールする方法の紹介
- [[Sustainable Pace » gerrit>http://sustainablepace.okadatech.com/sustainablepace/%E3%83%AC%E3%83%93%E3%83%A5%E3%83%BC/%E3%82%B3%E3%83%BC%E3%83%89%E3%83%AC%E3%83%93%E3%83%A5%E3%83%BC/gerrit]]