之前寫過Centos6.9下安裝Gitlab,總體來說Centos6和Centos7環境安裝Gitlab差別不大,本文以Centos7.4為例來安裝Gitlab。
1、添加gitlab源
vi /etc/yum.repos.d/gitlab-ce.repo
[gitlab-ce]
name=gitlab-ce
baseurl= http://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el $releasever
gpgcheck=0
enabled=1
2、安裝gitlab
yum -y install openssh-server cronie git wget patch gitlab-ce-10.5.1
3、初始化gitlab
gitlab-ctl reconfigure
PS:可以在/etc/gitblab/gitlab.rb修改external_url,改成自己的url
4、檢視服務
gitlab-ctl status
5、重新開機、停止或啟動服務
gitlab-ctl restart/stop/start
安裝完成,可以通過浏覽器通路IP測試(如通路不了,請檢查iptables、selinux)
http://IPgitlab漢化
Gitlab中文社群版位址:
https://gitlab.com/xhang/gitlab1、克隆版本庫(時間會很長,可以考慮挂代理,或者用自己的海外伺服器中轉下)
cd /usr/src/
git clone https://gitlab.com/xhang/gitlab.git
2、确定目前Gitlab版本
cat /opt/gitlab/embedded/service/gitlab-rails/VERSION
3、比較原标簽和漢化标簽,導出patch用的diff檔案
cd gitlab
git diff v10.5.1 v10.5.1-zh> ../10.5.1-zh.diff
4、先停止gitlab
gitlab-ctl stop
5、上傳10.5.1-zh.diff檔案到伺服器
patch -d /opt/gitlab/embedded/service/gitlab-rails -p1 < ../10.5.1-zh.diff
6、然後啟動gitlab
gitlab-ctl start
此時通路
就是全中文頁面了(啟動後馬上打開頁面可能會顯示502,稍等幾秒重新整理就好了)
