GitLab 導入記録

■環境
Ubuntu Desktop 12.04 (日本語Remix vhd)
・OpenSSL, OpenSSH インストール済み

Ruby、RVM、Railsをインストール
http://d.hatena.ne.jp/qkrhn081/20121030/1351580476

■GitLab
以下の手順を忠実に実行
https://github.com/gitlabhq/gitlabhq/blob/5-0-stable/doc/install/installation.md

■Jenkins
http://d.hatena.ne.jp/qkrhn081/20120525/1337924233

■GitLab - Jenkins連携
以下を参考に実施。(ユーザー名、リポジトリ名などは読み替えること)
http://d.hatena.ne.jp/katsuren/20121031/1351660354

■Pivotal Tracker, Jenkins とのHook設定 (GitLab push時)
以下を参考に、対象プロジェクトリポジトリ内の post-receive に Hookスクリプトを記述。
https://github.com/tokumura/post-receive/blob/master/post-receive

■注意点

Railsインストールで"file 'lib' not"とかがでたら以下を一発。

$ sudo gem install rdoc

もしくは

$ sudo gem install rails --no-ri --no-rdoc


・インストール後、GitLabにアクセスしてSSH-Keyを登録しておくこと(とくにJenkinsユーザー)
 "can't be established. ECDSA key fingerprint is" で登録できない場合、公開鍵のコピペがうまくいっていないだけの可能性あり。

・Jenkinsユーザーにパスワードセットすること。

$ sudo passwd jenkins

・Jenkinsユーザーで git config --global user.name と user.email をたたいておくこと。

$ git config --global user.name "Your Name"
$ git config --global user.name "yourmail@your.domain.co.jp"

・Jenkinsユーザーで bundle install の際、パスワードを聞かれたら以下を一発。

$ sudo addgroup admin
$ sudo usermod -G admin jenkins