From 6f71d4d823c8b17d50ff0f4223f5b7cbaaa7ffc7 Mon Sep 17 00:00:00 2001 From: bserie Date: Fri, 18 Nov 2016 10:47:08 +0100 Subject: [PATCH] =?UTF-8?q?Partie=20"mise=20=C3=A0=20jour".?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HowtoGitlab/8.13.md | 86 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 85 insertions(+), 1 deletion(-) diff --git a/HowtoGitlab/8.13.md b/HowtoGitlab/8.13.md index cd513d1c..b16574d3 100644 --- a/HowtoGitlab/8.13.md +++ b/HowtoGitlab/8.13.md @@ -308,6 +308,9 @@ GitLab ne supporte pas officiellement systemd… On doit donc encore passer pas # install -m 755 /home/gitlab-demo00/gitlab/lib/support/init.d/gitlab /etc/init.d/gitlab-demo00 # systemctl enable gitlab-demo00 # sed -i 's#script_path = "/etc/init.d/gitlab"#script_path = "/etc/init.d/gitlab-demo00"#g' /home/gitlab-demo00/gitlab/lib/tasks/gitlab/check.rake +# sudo -iu gitlab-demo00 +$ cd gitlab +$ git commit -a -m 'change default user' ``` ### Logrotate @@ -371,7 +374,88 @@ Si tout est au vert, c'est bon ! On pourra aller sur l'instance via https://demo # Mise à jour -**TODO** +## Mineure + +Pour les mises à jour mineure, par exemple de 8.13.5 vers 8.13.6, c'est surtout basé sur un simple `git pull` et un `git checkout`. + +### Backup + +``` +# sudo -iu gitlab-demo00 +$ cd gitlab +$ bundle exec rake gitlab:backup:create RAILS_ENV=production +``` + +### Arrêt du service + +``` +# /etc/init.d/gitlab-demo00 stop +``` + +### Mise à jour de GitLab + +``` +# sudo -iu gitlab-demo00 +$ cd gitlab +$ git fetch --all +$ git checkout -- Gemfile.lock db/schema.rb +$ git checkout v8.13.6 -b v8.13.6 +$ sed -i s'/app_user="git"/app_user="gitlab-demo00"/' lib/support/init.d/gitlab +$ sed -i 's#script_path = "/etc/init.d/gitlab"#script_path = "/etc/init.d/gitlab-demo00"#g' lib/tasks/gitlab/check.rake +$ git commit -a -m 'change default user' +``` + +### Mise à jour de gitlab-shell + +``` +$ cd ~/gitlab-shell +$ git fetch +$ git checkout v$(cat ~/gitlab/GITLAB_SHELL_VERSION) -b v$(cat ~/gitlab/GITLAB_SHELL_VERSION) +``` + +### Mise à jour de gitlab-workhorse + +``` +$ cd ~/gitlab-workhorse +$ git fetch +$ git checkout v$(cat ~/gitlab/GITLAB_WORKHORSE_VERSION) -b v$(cat ~/gitlab/GITLAB_WORKHORSE_VERSION) +$ make +``` + +### Mise à jour BDD, 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 assets:clean assets:precompile cache:clear RAILS_ENV=production +``` + +### Démarrer GitLab + +``` +# /etc/init.d/gitlab-demo00 start +# /etc/init.d/nginx restart +``` + +### Vérifier le status + +``` +# sudo -iu gitlab-demo00 +$ 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é ! + +## Majeure + +Pour les mises à jour majeure, par exemple de 8.13 à 8.14, il y a une documentation officielle bien défini. +[Liste des documentations d'upgrades majeure.](https://gitlab.com/gitlab-org/gitlab-ce/tree/master/doc/update) + +> **Note** : Si nous n'avons pas encore écrit le howto de migration, il faudra bien penser à faire les adaptations nécessaires (chemin, nom d'utilisateur, …). # Création d'une autre instance