From 0f9d4c7005ef87b0ba7f99bff8494f95f8f6fa8c Mon Sep 17 00:00:00 2001 From: bserie Date: Tue, 16 May 2017 17:21:59 +0200 Subject: [PATCH] Migration vers 9 --- HowtoGitlab/8.md | 84 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 83 insertions(+), 1 deletion(-) diff --git a/HowtoGitlab/8.md b/HowtoGitlab/8.md index cf6b4b16..21bc2f19 100644 --- a/HowtoGitlab/8.md +++ b/HowtoGitlab/8.md @@ -495,9 +495,91 @@ $ npm install --production $ bundle exec rake gitlab:assets:clean gitlab:assets:compile cache:clear RAILS_ENV=production ``` +Il est aussi nécessaire de disposer de l'outil [Yarn](https://wiki.evolix.org/HowtoYarn). + ## Mise à jour majeure -En attente de la version 9 :) +D'une version 8.x.y à 9.x.y. + +### Sauvegarde + +~~~ +# sudo -iu foo +$ cd gitlab +$ bundle exec rake gitlab:backup:create RAILS_ENV=production +~~~ + +### Mise à jour de GitLab + +~~~ +$ umask 002 +$ git fetch --all +$ git checkout -- Gemfile.lock db/schema.rb +$ git checkout -B v9-0-stable 9-0-stable +$ sed -i -e s'/app_user="git"/app_user="foo"/' \ + -e 's/# Provides: .*gitlab$/# Provides: gitlab-foo/' \ + lib/support/init.d/gitlab +$ sed -i 's#script_path = "/etc/init.d/gitlab"#script_path = "/etc/init.d/gitlab-foo"#g' lib/tasks/gitlab/check.rake +$ git commit -a -m 'change default user' +~~~ + +### Mise à jour de gitlab-shell + +~~~ +$ cd ~/gitlab-shell +$ git fetch --all --tags +$ git checkout -B v$(< ~/gitlab/GITLAB_SHELL_VERSION) $(< ~/gitlab/GITLAB_SHELL_VERSION) +~~~ + +### Mise à jour de gitlab-workhorse + +~~~ +$ cd ~/gitlab-workhorse +$ git fetch --all --tags +$ git checkout -B v$(< ~/gitlab/GITLAB_WORKHORSE_VERSION) tags/v$(< ~/gitlab/GITLAB_WORKHORSE_VERSION) +$ make +~~~ + +### Merger les fichiers de configurations + +~~~ +$ cd ~/gitlab +$ vimdiff config/gitlab.yml <(git show origin/9-0-stable:config/gitlab.yml.example) +~~~ + +~~~ +# cd /home/foo/gitlab +# vimdiff /etc/nginx/sites-available/gitlab-demo00 <(git show origin/9-0-stable:lib/support/nginx/gitlab-ssl) +~~~ + +### Mise à jour base de données, Gems et assets + +~~~ +$ cd ~/gitlab +$ bundle install --without development test mysql aws kerberos --deployment +$ bundle clean +$ bundle exec rake db:migrate RAILS_ENV=production +$ bundle exec rake yarn:install gitlab:assets:clean gitlab:assets:compile RAILS_ENV=production NODE_ENV=production +$ bundle exec rake cache:clear RAILS_ENV=production +$ git commit -a -m 'upgraded to 9-0-stable' +~~~ + +### Redémarrer GitLab + +~~~ +# /etc/init.d/gitlab-foo restart +~~~ + +### Vérifier le statut + +~~~ +# sudo -iu foo +$ cd gitlab +$ bundle exec rake gitlab:env:info RAILS_ENV=production +$ bundle exec rake gitlab:check RAILS_ENV=production +~~~ + +Si tout est au vert, la migration s'est bien passée ! # Divers / FAQ