0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Gitlabアップデート 6.0 -> 7.2

Posted at

===========================

Gitlab 5.0のインストール (CentOS 6.5)
Gitlabアップデート 5.0 -> 6.0

の後に行った作業です。

Requirements

  • CentOS (Tested on 6.5)
  • ruby (Tested on 2.1.2)

Upgrade

  • gitlab停止
service gitlab stop
  • バックアップ
su - git
cd /home/git/gitlab
mkdir /home/git/gitlab/public/uploads
chown git:git /home/git/gitlab/public/uploads
bundle exec rake gitlab:backup:create RAILS_ENV=production
  • rubyをアップグレード
su - git
curl -sSL https://get.rvm.io | bash -s stable
rvm install 2.1.2
cd /home/git/gitlab
echo ruby-2.1.2 > .ruby-version
  • /etc/init.d/gitlabに以下を追記
export GEM_HOME=/home/git/.rvm/gems/ruby-2.1.2
export MY_RUBY_HOME=/home/git/.rvm/rubies/ruby-2.1.2
export PATH=/home/git/.rvm/gems/ruby-2.1.2/bin:/home/git/.rvm/gems/ruby-2.1.2@global/bin:/home/git/.rvm/rubies/ruby-2.1.2/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/git/.rvm/bin:/home/git/bin:/home/git/.rvm/bin
export GEM_PATH=/home/git/gitlab/vendor/bundle:/home/git/.rvm/gems/ruby-2.1.2:/home/git/.rvm/gems/ruby-2.1.2@global
export RUBY_VERSION=ruby-2.1.2
  • bashrcにも追記
export GEM_HOME=/home/git/.rvm/gems/ruby-2.1.2
export MY_RUBY_HOME=/home/git/.rvm/rubies/ruby-2.1.2
export PATH=/home/git/.rvm/gems/ruby-2.1.2/bin:/home/git/.rvm/gems/ruby-2.1.2@global/bin:/home/git/.rvm/rubies/ruby-2.1.2/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/git/.rvm/bin:/home/git/bin:/home/git/.rvm/bin
export GEM_PATH=/home/git/gitlab/vendor/bundle:/home/git/.rvm/gems/ruby-2.1.2:/home/git/.rvm/gems/ruby-2.1.2@global
export RUBY_VERSION=ruby-2.1.2
  • rootユーザにもrvmをシングルモードでインストール
echo 'export rvm_prefix="$HOME"' > /root/.rvmrc
echo 'export rvm_path="$HOME/.rvm"' >> /root/.rvmrc
curl -sSL https://get.rvm.io | bash -s stable
rvm install 1.9.3
echo 'source "$HOME/.rvm/scripts/rvm"' >> /root/.bashrc
  • gitlab最新のコードを取得&チェックアウト
git fetch --all
git checkout 7-2-stable
  • gitlab-shellのアップグレード
cd /home/git/gitlab-shell
sudo -u git -H git fetch
sudo -u git -H git checkout v1.9.7
  • 依存パッケージのインストール、マイグレーション、その他
yum install cmake
bundle install --verbose --without development test postgres --deployment
bundle exec rake migrate_iids RAILS_ENV=production
bundle exec rake db:migrate RAILS_ENV=production
bundle exec rake assets:clean assets:precompile cache:clear RAILS_ENV=production
chmod u+rwx,g+rx,o-rwx /home/git/gitlab-satellites
  • コンフィグファイルの更新
cd /home/git/gitlab/config
cp gitlab.yml{,.bak}
curl -L -O  https://gitlab.com/gitlab-org/gitlab-ce/raw/7-2-stable/config/gitlab.yml.example
cp gitlab.yml.example gitlab.yml
vim gitlab.yml
環境に合わせて編集

cp unicorn.rb{,.bak}
curl -L -O https://gitlab.com/gitlab-org/gitlab-ce/raw/7-2-stable/config/unicorn.rb.example
cp unicorn.rb.example unicorn.rb
vim unicorn.rb
環境に合わせて編集
cd /home/git/gitlab
cp config/initializers/rack_attack.rb.example config/initializers/rack_attack.rb
cp lib/support/logrotate/gitlab /etc/logrotate.d/gitlab
# initスクリプト更新
cp lib/support/init.d/gitlab /etc/init.d/gitlab
  • gitlab起動
service gitlab start
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?