安裝
線上安裝,支援的 OS 有 Ubuntu、Debian、CentOS、Raspberry PI 2 on Raspbian。直接依照說明即可完成。
建議安裝時也同時下載目前安裝的版本,避免之後有移轉問題需要還原。各版本下載位址為
備份
# 執行備份
gitlab-rake gitlab:backup:create
還原
# 複製備份檔至備份路徑
sudo cp 1493107454_2017_04_25_9.1.0_gitlab_backup.tar /var/opt/gitlab/backups/
# 停止服務
sudo gitlab-ctl stop unicorn
sudo gitlab-ctl stop sidekiq
# 開始還原
sudo gitlab-rake gitlab:backup:restore BACKUP=1493107454_2017_04_25_9.1.0
# 啟動系統
sudo gitlab-ctl start
# 檢查還原結果
sudo gitlab-rake gitlab:check SANITIZE=true
由 SVN 移轉
建立 svn 與 git 作者的 mapping 檔(author.txt)
nanashi07 = Bruce <nanashi07@haha.com>
由 svn 簽出為 git 專案
# clone from svn
# with standard layout(trunk/branches/tags), "-s" argument is required
# "author.txt" contains a list that svn accounts mapping to git authors
git svn clone https://10.10.10.162/svn/caml/Caml.Maker --authors-file=author.txt --no-metadata -s Caml.Maker
cd Caml.Maker
# convert tags
git for-each-ref refs/remotes/tags | cut -d / -f 4- | grep -v @ | while read tagname; do git tag "$tagname" "tags/$tagname"; git branch -r -d "tags/$tagname"; done
# convert branches
git for-each-ref refs/remotes | cut -d / -f 3- | grep -v @ | while read branchname; do git branch "$branchname" "refs/remotes/$branchname"; git branch -r -d "$branchname"; done
# add remote repository
git remote add origin http://nanashi07:password@10.10.10.222/caml/Caml.Maker.git
# push to remote
git push origin --all
cd ..
升級
# 停止服務
sudo gitlab-ctl stop unicorn
sudo gitlab-ctl stop sidekiq
sudo gitlab-ctl stop nginx
# 備份
sudo gitlab-rake gitlab:backup:create
# 安裝下載的檔案
# Ubuntu/Debian:
sudo dpkg -i gitlab_x.x.x-omnibus.xxx.deb
# CentOS:
sudo rpm -Uvh gitlab-x.x.x_xxx.rpm
# 重新設定與啟動
sudo gitlab-ctl reconfigure
sudo gitlab-ctl restart