一、環(huán)境準備
1.1、下載wget
# yum install -y vim
# yum install -y wget
# cd /usr/local
# wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el6/gitlab-ce-10.0.2-ce.0.el6.x86_64.rpm
1.2、關(guān)閉防火墻
# service iptables stop
# chkconfig iptables off
二、獲取GitLab漢化包(要部署非漢化版,可以跳過這一塊內(nèi)容)
2.1、安裝Git
# yum install -y git
2.2、克隆獲取漢化版本庫
# cd /usr/local
# git clone https://gitlab.com/xhang/gitlab.git
三、部署社區(qū)版GitLab
3.1、安裝GitLab的依賴項
# yum -y install policycoreutils openssh-server openssh-clients postfix cronie policycoreutils-python
3.2、啟動postfix,并設(shè)置為開機啟動
# service postfix start
# chkconfig postfix on
3.3、安裝rpm包
# cd /usr/local
# rpm -ivh gitlab-ce-10.0.2-ce.0.el6.x86_64.rpm
3.4、修改配置文件gitlab.rb
# vim /etc/gitlab/gitlab.rb
將external_url變量的地址修改為gitlab所在centos的ip地址
修改GitLab默認端口
unicorn['port'] = '9092'

因為修改了配置文件,故需要重新加載配置內(nèi)容。
# gitlab-ctl reconfigure
# gitlab-ctl restart
四、覆蓋漢化包
4.1、停止GitLab服務(wù)
# gitlab-ctl stop
4.2、比較漢化標簽和原標簽,導(dǎo)出 patch 用的 diff 文件到/root下
# cd /usr/local/gitlab
# git diff v10.0.2 v10.0.2-zh > ../10.0.2-zh.diff
4.3、將10.0.2-zh.diff作為補丁更新到GitLab中
# cd /usr/local
# yum install patch -y
# patch -d /opt/gitlab/embedded/service/gitlab-rails -p1 < 10.0.2-zh.diff
Tips:重啟GitLab
# gitlab-ctl reconfigure
# gitlab-ctl restart