Centos 6.3 に GitLab 6.0 をいれたおはなし

GitHub クローンの GitLab を導入してみました。

MySQL の GitLab ユーザ作成

# mysql -uroot -p
mysql> grant all on gitlabhq_production.* to gitlab@localhost identified by '[PASSWORD]';
mysql> exit

Redis のインストール

# yum install redis --enablerepo=epel
# chkconfig redis on
# service redis start

依存パッケージのインストール

# yum install libicu-devel

GitLab ユーザ作成

# useradd git

GitLab ユーザの git 設定

# su - git

$ git config --global user.name  "GitLab"
$ git config --global user.email "gitlab@git.example.jp"

GitLab shell のインストール

$ git clone https://github.com/gitlabhq/gitlab-shell.git
$ cd gitlab-shell
$ git checkout v1.7.0
$ git checkout -b v1.7.0

$ cp config.yml.example config.yml
$ vi config.yml
gitlab_url: http://[FQDN]

$ ./bin/install

GitLab インストール

$ cd
$ git clone https://github.com/gitlabhq/gitlabhq.git gitlab
$ cd gitlab
$ git checkout v6.0.0
$ git checkout -b v6.0.0

$ cp config/gitlab.yml.example config/gitlab.yml
$ vi config/gitlab.yml
production:
  gitlab:
    host: [FQDN]
    email_from: gitlab@[FQDN]
    support_email: support@[FQDN]

$ cp config/database.yml.mysql config/database.yml
$ vi config/database.yml
production:
  username: gitlab
  password: ""

$ mkdir tmp/pids/

$ bundle install --deployment --without development test postgres
$ bundle exec rake db:create RAILS_ENV=production
$ bundle exec rake gitlab:setup RAILS_ENV=production

あとは Passenger とかで適に。 GitLab さんアイコンがキモいのだけゆるせない。