GitLabバージョンアップ方法
2014年2月22日
公式サイトのReadmeとか読むほうが確実ですが、面倒なので、適当にコマンドを叩いて、成功したのでその方法を記載しておきます。(適当そうに書いてますが、一応Railsはそこそこ知っていますので、大きく外していることはないと思います。)
この記事は、既にGitLabを導入済みで、そのGitLabのバージョンを上げたいという人向けの記事なので、そもそもGitLabすらインストールしていない場合は、この記事やこの記事を参照してみてください。
現在運用中のgitlabフォルダをバックアップしておく
[bash]
$ mv gitlab gitlab.pre
[/bash]
最新版GitLab ダウンロード
https://github.com/gitlabhq/gitlabhq/releases
ここから最新っぽいもののバージョンをダウンロードしてください。
[bash]
# su – git
$ wget https://github.com/gitlabhq/gitlabhq/archive/v6.6.0.zip
[/bash]
最新版を解凍し、フォルダ名をリネーム
[bash]
$ unzip v6.6.0
$ mv gitlabhq-6.6.0 gitlab
[/bash]
コンフィグファイルを旧環境からコピー
[bash]
$ cd gitlab
$ cp ../gitlab.pre/config/database.yml config/
$ cp ../gitlab.pre/config/gitlab.yml config/
[/bash]
かなりバージョンアップを放置していた場合は、gitlab.ymlの形式が変更されているケースもありますので、config/gitlab.yml.exampleをベースに調整してください。
不足フォルダを作成
[bash]
$ mkdir /home/git/gitlab/tmp/pids
$ mkdir /home/git/gitlab/public/uploads
[/bash]
バンドル インストール(気長に待ちましょう!)
[bash]
$ bundle install –deployment –without development test postgres
[/bash]
アセットプリコンパイル(そこそこ待ちます)
[bash]
$ rake assets:precompile RAILS_ENV=production
[/bash]
データベース マイグレーション
[bash]
$ rake db:migrate RAILS_ENV=production
[/bash]
こんなエラーメッセージが出たりしますが、多分気にしなくてOKです。(適当・・)
fatal: Not a git repository (or any of the parent directories): .git
サービス再起動
[bash]
# service gitlab restart
# service httpd restart
[/bash]
動作確認(少し待ちます)
ブラウザーでgitlabのURLへアクセスしてみてください。

Leave a comment