インストールが大変という定評のあった GitLab ですが、マニュアルインストールとアップグレードで凌いでいました。
GitLab CI を導入しようと試す過程で、サブディレクトリ運用だと OAuth 連携が上手くいかないことがわかりました。
現在はオールインワンのパッケージが提供されているため、下記を使えば簡単に GitLab, GitLab CI を一気に入れることができます。Nginx、PostgreSQL、Redis なども全てまとめて /opt/gitlab に入ります。 GitLab | Download GitLab Community Edition (CE)
サーバスペックをアップグレードするついでに上げますが、基本的にバーチャルホストを使うため FQDN を GitLab, GitLab CI で同じにできません。SSL 証明書に関しては、ワイルドカードを持ってないと辛いところです。
GitLab を最新に更新 下記の手順どおりやれば簡単に今は上がります。
gitlabhq/upgrader.md at master · gitlabhq/gitlabhq · GitHub
バックアップ $ cd /home/git/gitlab $ sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production サービス停止 $ sudo service gitlab stop アップグレード $ sudo -u git -i $ bundle exec rake gitlab:backup:create RAILS_ENV=production $ cd gitlab $ ruby bin/upgrade.rb GitLab 7 upgrade tool Your version is 7.5.3 Latest available version for GitLab 7 is 7.7.2 Newer GitLab version is available Do you want to upgrade (yes/no)? yes Stash changed files -\> git stash Saved working directory and index state WIP on 7-5-stable: b656b85 Version 7.5.3 HEAD is now at b656b85 Version 7.5.3 -\> OK Get latest code -\> git fetch remote: Counting objects: 7452, done. remote: Compressing objects: 100% (3095/3095), done. remote: Total 7452 (delta 5170), reused 6001 (delta 4268) Receiving objects: 100% (7452/7452), 2.18 MiB | 387.00 KiB/s, done. Resolving deltas: 100% (5170/5170), done. From https://github.com/gitlabhq/gitlabhq (省略) \* \[new tag\] v7.7.2 -> v7.7.2 -\> OK Switch to new version -\> git checkout v7.7.2 Note: checking out 'v7.7.2'. You are in 'detached HEAD' state. You can look around, make experimental changes and commit them, and you can discard any commits you make in this state without impacting any branches by performing another checkout. If you want to create a new branch to retain commits you create, you may do so (now or later) by using -b with the checkout command again. Example: git checkout -b new\_branch\_name HEAD is now at bd98290... Version 7.7.2 -\> OK Install gems -\> bundle Fetching source index from https://rubygems.org/ (省略) Your bundle is complete! Gems in the groups development, test and postgres were not installed. It was installed into ./vendor/bundle -\> OK Migrate DB -\> bundle exec rake db:migrate (省略) -\> OK Recompile assets -\> bundle exec rake assets:clean assets:precompile (省略) -\> OK Clear cache -\> bundle exec rake cache:clear -\> OK Done サービス起動 $ sudo service gitlab start このタイミングで自分の環境では、rbenv で入っていたのが、2.1.3 で 2.1.5 じゃないとエラーが出ました。 /home/git/gitlab/.ruby-version を 2.1.5 に書き換えたら動きました。
...