Gitlab 2.9.1 升級到 3.0


睡醒起來.才發現昨晚安裝的 Gitlab 發佈了3.0.
所以只好再將他升級到 3.0 看看.
又來記錄一下.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# 先停掉運行中的 Gitlab
sudo service gitlab stop

# 切到主目錄裡面
cd /home/gitlab/gitlab

# 拉下目前最新的分支
git pull origin stable

# 安裝一些可能新的 Bundle
bundle install --without development test postgres

# 合並到新的資料庫結構
bundle exec rake db:migrate RAILS_ENV=production

# 修改 Gitolite 的設定 (這裡是 v2 版本, v3 請看下面)
sudo -u git -H sed -i 's/\(GL_GITCONFIG_KEYS\s*=>*\s*\).\{2\}/"\.\*"/g' /home/git/.gitolite.rc

# 再次測試一下環境,全綠就對了
bundle exec rake gitlab:app:status RAILS_ENV=production

# 沒問題就全新執行 Gitlab
sudo service gitlab start

# 問題
如果在檢查 status 時出錯.
請確保 /home/git/.gitolite.rc 檔案內的 GL_GITCONFIG_KEYS,
是否正確已版設定為 $GL_GITCONFIG_KEYS = ".*",

如果是 v3 版本的,
應該執行

sudo -u git -H sed -i "s/\(GIT_CONFIG_KEYS\s*=>*\s*\).\{2\}/\1'\.\*'/g" /home/git/.gitolite.rc

# 錯誤
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LC_CTYPE = "UTF-8",
LANG = (unset)
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
warning: You appear to have cloned an empty repository.

# 解決
locale-gen en_US en_US.UTF-8

dpkg-reconfigure locales (選擇對應的 locales)