一俺祠、環(huán)境準(zhǔ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è)置為開機(jī)啟動
# 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默認(rèn)端口
unicorn['port'] = '9092'
因為修改了配置文件畅厢,故需要重新加載配置內(nèi)容。
# gitlab-ctl reconfigure
# gitlab-ctl restart
四氮昧、覆蓋漢化包
4.1框杜、停止GitLab服務(wù)
# gitlab-ctl stop
4.2、比較漢化標(biāo)簽和原標(biāo)簽袖肥,導(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作為補(bǔ)丁更新到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