18
0
Fork 0

Partie "mise à jour".

This commit is contained in:
Benoît S. 2016-11-18 10:47:08 +01:00
parent 106bc079b1
commit 6f71d4d823
1 changed files with 85 additions and 1 deletions

View File

@ -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