Centos 7 安裝 gitlab 以及漢化
阿新 • • 發佈:2018-12-29
一:安裝
1:新增yum配置檔案
# vim /etc/yum.repos.d/gitlab-ce.repo
[gitlab-ce] name=gitlab-ce baseurl=http://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el6 repo_gpgcheck=0 gpgcheck=0 enabled=1 gpgkey=https://packages.gitlab.com/gpg.key
2:安裝依賴包。
yum install curl openssh-server openssh-clients postfix crouie systemctl start postfix
3:安裝gitlab-ce
yum makecache yum install gitlab-ce gitlab-ctl reconfigure
注:如果想安裝指定版本,在後面加上版本號,例如:yum install gitlab-ce-11.5.5
首次初始化時間比較長。
4:修改gitlab配置檔案gitlab.rb
#vim /etc/gitlab/gitlab.rb
將 external_url 後面的url改為你訪問的地址。也可以使用IP。
5:每次修改/etc/gitlab/gitlab.rb後,都需要重新載入配置檔案。
gitlab-ctl reconfigure gitlab-ctl restart
6:瀏覽器訪問
注:首次登入需要配置管理員root的密碼。
二:漢化
1:首先檢視gitlab的版本,漢化包版本和gitlab版本需一致。
cat /opt/gitlab/embedded/service/gitlab-rails/VERSION
2:克隆漢化包。
yum install git -y git clone https://gitlab.com/xhang/gitlab.git
注:速度看人品,有時快,有時慢。有vps最好用vps下載,上面的命令是克隆最新版漢化包到本地。目前最新漢化包更新到11.5.5。目前最新gitlab版本為11.6.0,注意版本一致。 2018/12/29
3:解壓,進入解壓包中拉取漢化包補丁。
git diff v10.0.2 v11.5.5-zh > ../11.5.5-zh.diff
注:解壓過程省略,此操作是在解壓後進入解壓包中操作。如果使用vps克隆,而gitlab搭建在本地伺服器上,將生成的 11.5.5-zh.diff拷貝到gitlab伺服器/root目錄,不需要拷貝整個漢化包。
4:停止gitlab伺服器進行漢化升級(打補丁)。
gitlab-ctl stop patch -d /opt/gitlab/embedded/service/gitlab-rails -p1 < 11.5.5-zh.diff
注:一直回車,敲回車都會敲到你懷疑人生。
此步驟也可以用git自帶打補丁方式進行如下:
cd /opt/gitlab/embedded/service/gitlab-rails git apply /root/11.5.5-zh.diff
5:啟動gitlab並驗證
gitlab-ctl start