gitlab 2.0 をcentos 5.5にインストール
gitlab 2.0のセットアップに必要なもの
- git, gitolite ( gitosisでもできると思うけど, 2.0からgitoliteが使えるようなので )
- ruby 1.9.2以上 ( 公式には1.9.2と書いてるけど最新が1.9.3だったのでそれを使った )
- redis ( 必要らしいけど、何に使うかいまいちわかってない )
- sqlite3 ( 標準ではこれを使うらしい。mysql使おうとしたけどだめだった。あまり追ってないけど )
環境
- ruby 1.9.3p0
- rpmを作ってインストールした
- git 1.7.2.1
- redis 2.0.0
- thin 1.3.1
まずは、gitlabを適当な場所に配置
$ cd /srv
$ git clone git://github.com/gitlabhq/gitlabhq.git
gitoliteをインストールする ( gitlabというユーザを作った )
$ sudo /usr/sbin/useradd gitlab
$ sudo –H –u gitlab –s
$ ssh-keygen –f ./admin
$ mkdir -p $HOME/bin $HOME/gitolite/conf $HOME/gitolite/hooks
$ git clone git://github.com/sitaramc/gitolite gitolite-source
$ cd gitolite-source
$ src/gl-system-install $HOME/bin $HOME/gitolite/conf $HOME/gitolite/hooks
$ gl-setup $HOME/admin.pub
参考URL: http://webos-goodies.jp/archives/access_control_to_git_repositories_with_gitlite.html
bundle installとmigrateをする。 ruby-debug-base19インストールのためにruby-1.9.2-p290のソースが必要(四苦八苦してこれで解決した)
$ wget http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.2-p290.tar.gz –O /tmp/ruby-1.9.2-p290.tar.gz
$ mkdir /tmp/source
$ cd /tmp/source
$ tar –zxvf /tmp/ruby-1.9.2-p290.tar.gz
$ cd /srv/gitlabhq/
$ bundle config build.ruby-debug-base19 –with-ruby-include=/tmp/source/ruby-1.9.2-p290/
$ bundle install
$ bundle exec rake db:setup RAILS_ENV=production
$ bundle exec rake db:seed_fu RAILS_ENV=production
参考URL: http://stackoverflow.com/questions/7054948/ruby-debug19-on-ruby-1-9-3-preview1
thinを使って公開する
$ sudo cp /home/gitlab/admin /root/.ssh/id_rsa
$ sudo chmod 600 /root/.ssh/id_rsa
$ cat /root/thin.conf
port: 80
pid: tmp/pids/thin.pid
log: log/thin.log
address: 0.0.0.0
max_persistent_conns: 50
max_conns: 50
timeout: 600
wait: 30
require: []environment: production
daemonize: true
chdir: /srv/gitlabhq$ sudo thin –c /root/thin.conf
以上でgitlab構築完了
現状ではzipなどのアーカイブではダウンロードできない。(主にこれを期待してたんだけど、構築に専念しすぎた)
redisは何に使っているかいまいちわかりません。
