Commit 775aa5ba7ce5ef335bcae81bbc2bf8b7b1321303
1 parent
055b60d4
Exists in
master
and in
4 other branches
Update install/update docs.
Showing
2 changed files
with
107 additions
and
0 deletions
Show diff stats
doc/install/installation.md
| ... | ... | @@ -195,6 +195,13 @@ You can change `6-1-stable` to `master` if you want the *bleeding edge* version, |
| 195 | 195 | # Ex. change amount of workers to 3 for 2GB RAM server |
| 196 | 196 | sudo -u git -H editor config/unicorn.rb |
| 197 | 197 | |
| 198 | + # Copy the example Rack attack config | |
| 199 | + sudo -u git -H cp config/initializers/rack_attack.rb.example config/initializers/rack_attack.rb | |
| 200 | + | |
| 201 | + # Enable rack attack middleware | |
| 202 | + # Find and uncomment the line 'config.middleware.use Rack::Attack' | |
| 203 | + sudo -u git -H editor config/application.rb | |
| 204 | + | |
| 198 | 205 | # Configure Git global settings for git user, useful when editing via web |
| 199 | 206 | # Edit user.email according to what is set in gitlab.yml |
| 200 | 207 | sudo -u git -H git config --global user.name "GitLab" | ... | ... |
| ... | ... | @@ -0,0 +1,100 @@ |
| 1 | +# From 6.1 to 6.2 | |
| 2 | + | |
| 3 | +# You should update to 6.1 before installing 6.2 so all the necessary conversions are run. | |
| 4 | + | |
| 5 | +### 0. Backup | |
| 6 | + | |
| 7 | +It's useful to make a backup just in case things go south: | |
| 8 | +(With MySQL, this may require granting "LOCK TABLES" privileges to the GitLab user on the database version) | |
| 9 | + | |
| 10 | +```bash | |
| 11 | +cd /home/git/gitlab | |
| 12 | +sudo -u git -H RAILS_ENV=production bundle exec rake gitlab:backup:create | |
| 13 | +``` | |
| 14 | + | |
| 15 | +### 1. Stop server | |
| 16 | + | |
| 17 | + sudo service gitlab stop | |
| 18 | + | |
| 19 | +### 2. Get latest code | |
| 20 | + | |
| 21 | +```bash | |
| 22 | +cd /home/git/gitlab | |
| 23 | +sudo -u git -H git fetch | |
| 24 | +sudo -u git -H git checkout 6-2-stable | |
| 25 | +``` | |
| 26 | + | |
| 27 | +### 3. Update gitlab-shell | |
| 28 | + | |
| 29 | +```bash | |
| 30 | +cd /home/git/gitlab-shell | |
| 31 | +sudo -u git -H git fetch | |
| 32 | +sudo -u git -H git checkout v1.7.1 | |
| 33 | +``` | |
| 34 | + | |
| 35 | +### 4. Install libs, migrations, etc. | |
| 36 | + | |
| 37 | +```bash | |
| 38 | +cd /home/git/gitlab | |
| 39 | + | |
| 40 | +# MySQL | |
| 41 | +sudo -u git -H bundle install --without development test postgres --deployment | |
| 42 | + | |
| 43 | +#PostgreSQL | |
| 44 | +sudo -u git -H bundle install --without development test mysql --deployment | |
| 45 | + | |
| 46 | + | |
| 47 | +sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production | |
| 48 | +sudo -u git -H bundle exec rake migrate_iids RAILS_ENV=production | |
| 49 | +sudo -u git -H bundle exec rake assets:clean RAILS_ENV=production | |
| 50 | +sudo -u git -H bundle exec rake assets:precompile RAILS_ENV=production | |
| 51 | +sudo -u git -H bundle exec rake cache:clear RAILS_ENV=production | |
| 52 | +``` | |
| 53 | + | |
| 54 | +### 5. Update config files | |
| 55 | + | |
| 56 | +* Make `/home/git/gitlab/config/gitlab.yml` same as https://github.com/gitlabhq/gitlabhq/blob/6-2-stable/config/gitlab.yml.example but with your settings. | |
| 57 | +* Make `/home/git/gitlab/config/unicorn.rb` same as https://github.com/gitlabhq/gitlabhq/blob/6-2-stable/config/unicorn.rb.example but with your settings. | |
| 58 | +* Copy rack attack middleware config | |
| 59 | +```bash | |
| 60 | +sudo -u git -H cp config/initializers/rack_attack.rb.example config/initializers/rack_attack.rb | |
| 61 | +``` | |
| 62 | +* Uncomment `config.middleware.use Rack::Attack` in `/home/git/gitlab/config/application.rb` | |
| 63 | + | |
| 64 | +### 6. Update Init script | |
| 65 | + | |
| 66 | +```bash | |
| 67 | +sudo rm /etc/init.d/gitlab | |
| 68 | +sudo curl --output /etc/init.d/gitlab https://raw.github.com/gitlabhq/gitlabhq/6-2-stable/lib/support/init.d/gitlab | |
| 69 | +sudo chmod +x /etc/init.d/gitlab | |
| 70 | +``` | |
| 71 | + | |
| 72 | +### 7. Start application | |
| 73 | + | |
| 74 | + sudo service gitlab start | |
| 75 | + sudo service nginx restart | |
| 76 | + | |
| 77 | +### 8. Check application status | |
| 78 | + | |
| 79 | +Check if GitLab and its environment are configured correctly: | |
| 80 | + | |
| 81 | + sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production | |
| 82 | + | |
| 83 | +To make sure you didn't miss anything run a more thorough check with: | |
| 84 | + | |
| 85 | + sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production | |
| 86 | + | |
| 87 | +If all items are green, then congratulations upgrade complete! | |
| 88 | + | |
| 89 | +## Things went south? Revert to previous version (6.1) | |
| 90 | + | |
| 91 | +### 1. Revert the code to the previous version | |
| 92 | +Follow the [`upgrade guide from 6.0 to 6.1`](6.0-to-6.1.md), except for the database migration | |
| 93 | +(The backup is already migrated to the previous version) | |
| 94 | + | |
| 95 | +### 2. Restore from the backup: | |
| 96 | + | |
| 97 | +```bash | |
| 98 | +cd /home/git/gitlab | |
| 99 | +sudo -u git -H RAILS_ENV=production bundle exec rake gitlab:backup:restore | |
| 100 | +``` | ... | ... |