BitnamiGitLabのアップグレードとTroubledshooting

11117 ワード

現在、GitLabはGitツールを使用してコードを管理するソフトウェアとして最も流行しており、オープンソースと企業バージョンがあります.GitLabのアップグレード方法を紹介します.Bitnamiのワンタッチインストールパッケージ、インストールパッケージアドレスを使用しています.
https://bitnami.com/stack/gitlab/installer
バージョン7.13.5から8.1.0、8.2.0にアップグレードしても構いません.
手順は次のとおりです.
1.Gitlabサーバを停止しpostgresqlとredis,ctlscriptを起動する.shはインストールディレクトリの下にあり、デフォルトは/opt/gitlab-7.13.5/ctlscript.sh、次のパスの「bitnami」がインストールしたパスに変更されていることに注意してください.
sudo /opt/bitnami/ctlscript.sh stop
sudo /opt/bitnami/ctlscript.sh start postgresql
sudo /opt/bitnami/ctlscript.sh start redis

2.Gitユーザーに切り替え、Gitlabshellをアップグレードすることが重要です.
sudo su git
cd /opt/bitnami/apps/gitlab/gitlab-shell
git stash
git fetch https://github.com/gitlabhq/gitlab-shell
git pull  #        ,         gitlab-shell        git 
git checkout v2.6.3  [replace it with the latest version]  #   checkout       ,   git branch -a      pull     
git stash apply
3.GitLabをバックアップします.ここでは省略します.
4.Githubでアップグレードしたいバージョンを見つけ、リンクはhttps://github.com/gitlabhq/gitlabhq/releases
自動アップグレードコマンドcd/opt/bitnami/apps/gitlab/htdocsの実行
 
  
ruby -Ilib -e 'require "gitlab/upgrader"' -e 'class Gitlab::Upgrader' -e 'def latest_version_raw' -e '"v8.1.0"' -e 'end' -e 'end' -e 'Gitlab::upgrader.new.execute'  #v8.1.0           
 
  
 
  
GitLab 7 upgrade tool
Your version is 7.13.5
Latest available version for GitLab 7 is 8.1.0
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 (no branch): 489b413 Version 7.13.5
HEAD is now at 489b413 Version 7.13.5
 -> OK
Get latest code
 -> git fetch
 -> OK
Switch to new version
 -> git checkout v8.1.0
Previous HEAD position was 489b413... Version 7.13.5
HEAD is now at b725318... Version 8.1.0
 -> OK
Install gems
 -> bundle
Fetching source index from https://rubygems.org/
"->記号の後に付いているOK以外は単独で実行可能なコマンドであることに注意してください.自動アップグレードコマンドが途中で切断された場合、デバッグエラーの後、手動でコマンドを実行して続行できます.このステップは自動的にアップグレードされます.
  Ruby   gems                       troubleshooting
5.    4      bundle      ,        ,          :
 
  
Your bundle is complete!
Gems in the groups development, test, sqlite, test and sqlite were not installed.
It was installed into ./vendor/bundle
Post-install message from httparty:
When you HTTParty, you must party hard!
6.バージョン7から8の最も重要な変化はhttp cloneコードを使用するモジュールが変更されたことですが、社内ではsshプロトコルが一般的に使用されているため、本稿ではこのモジュールのアップグレードには触れません.
     libs,bitnami     postgresql,
 
  
bundle install --without mysql development test --deployment
データベースの移行
 
  
bundle exec rake db:migrate RAILS_ENV=production
アップグレードによって生成されたキャッシュをクリア
 
  
 bundle exec rake assets:clean assets:precompile cache:clear RAILS_ENV=production
7.config fiesのアップグレード
            gitlab.yml            /opt/gitlab-x-x-x/apps/gitlab/htdocs/config/          
    
git diff origin/7-13-stable:config/gitlab.yml.example origin/8-0-stable:config/gitlab.yml.example
7.13バージョンと8.1のconfigファイルの違いを確認し、マイナス記号の先頭の削除を行い、先頭の追加を加えればよい.
8.     
             ,     gitlab    ,   ctlscript.sh restart     
      ,                     ,       ,       http        ,         
(1)                

bundle exec rake gitlab:env:info RAILS_ENV=production
(2)
        gems            
bundle exec rake gitlab:check RAILS_ENV=production
                    ,                    clone push      ,      ,       
      Bitnami    ,                gitlab           。   ,        Omnibus     
      ,    Bitnami    ,         。

Troubleshooting
1.   4  bundle  ,       ruby       gems ,                 ,    git  , htdocs     ,           Gemsfile  ,
gem sources -l       
    
https://rubygems.org/
gem sources -r https://rubygems.org/  #      
gem sources -a https://ruby.taobao.org/ #      
 htdocs   Gemfile  source       url       
  bundle        
2.    ,                         , repositories       git    ,repositories      GitLab              /opt/gitlab-7.13.5-0/apps/gitlab/  
3.         ssh  clone,   production.log      gitlabshell    gitlab-shell.log   git    ,          git  ,         git  clone             gitlab-shell        ,            ,      。

リファレンスリソース:
Bitnami公式サイトのアップグレード手順:https://wiki.bitnami.com/Applications/BitNami_GitLab#How_to_upgrade_Gitlab.3fここではbundleコマンドのみ実行できます
Gitlab公式サイトのアップグレード手順:https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/update/7.14-to-8.0.mdここでは7.14から8.0まで実は7.13でもいいですが、このリンクの下にあります.
httpサーバのアップグレード方法がありますが、httpプロトコルを使用する場合はここを参照してください.
Bitnamiの公式サイトのアップグレードだけでは正常にバージョン7からバージョン8にアップグレードできないので、Gitバージョン管理ソフトを探す段階で、公式サイトのOmnibusインストールパッケージやソースコードインストールをお勧めします.メンテナンスなどに便利です.