BigW Consortium Gitlab

5.0-to-5.1.md 2.11 KB
Newer Older
1
# From 5.0 to 5.1
2
*Make sure you view this [upgrade guide from the `master` branch](../../../master/doc/update/5.0-to-5.1.md) for the most up to date instructions.*
3

4
## Warning
5

6
GitLab 5.1 is affected by critical security vulnerability CVE-2013-4490.
7

8
## Release notes
9

10 11
- `unicorn` replaced with `puma`
- merge request cached diff will be truncated
12

13
## 1. Stop server
14 15 16

    sudo service gitlab stop

17
## 2. Get latest code
18

19 20
```bash
cd /home/git/gitlab
21 22 23 24
sudo -u git -H git fetch
sudo -u git -H git checkout 5-1-stable
```

25
## 3. Update gitlab-shell
26

27 28 29 30
```bash
cd /home/git/gitlab-shell
sudo -u git -H git fetch
sudo -u git -H git checkout v1.3.0
31 32 33 34 35
# replace your old config with the new one
sudo -u git -H mv config.yml config.yml.old
sudo -u git -H cp config.yml.example config.yml
# edit options to match old config
sudo -u git -H vi config.yml
36 37
```

38
## 4. Install libs, migrations etc
Grégoire Paris committed
39

40 41 42 43
```bash
cd /home/git/gitlab
sudo rm tmp/sockets/gitlab.socket
sudo -u git -H cp config/puma.rb.example config/puma.rb
Grégoire Paris committed
44

45
sudo -u git -H bundle install --without development test postgres --deployment
46 47
sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production
sudo -u git -H bundle exec rake migrate_merge_requests RAILS_ENV=production
48
sudo -u git -H bundle exec rake assets:precompile RAILS_ENV=production
49 50
```

51
## 5. Update init.d script with a new one
52 53 54 55

```bash
# init.d
sudo rm /etc/init.d/gitlab
Ben Bodenmiller committed
56
sudo curl -L --output /etc/init.d/gitlab https://raw.github.com/gitlabhq/gitlab-recipes/5-1-stable/init.d/gitlab
57 58 59
sudo chmod +x /etc/init.d/gitlab
```

60
## 6. MySQL grant privileges
61

62
Only if you are using MySQL:
63 64 65 66 67 68 69

```bash
mysql -u root -p
mysql> GRANT LOCK TABLES ON `gitlabhq_production`.* TO 'gitlab'@'localhost';
mysql> \q
```

70
## 7. Start application
71 72

    sudo service gitlab start
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91

## 8. Check installation


```bash
# In 5-10 seconds lets check gitlab-shell
sudo -u git -H /home/git/gitlab-shell/bin/check

# Example of success output
# Check GitLab API access: OK
# Check directories and files:
#         /home/git/repositories: OK
#         /home/git/.ssh/authorized_keys: OK


# Now check gitlab instance
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production

```