最近工做須要使用Gitlab,在網上查找了不少文章,參考了多位大神的成功經驗,終於被我安裝成功並漢化啦!在此感謝網上大神們的貢獻!我將多位大神的文章在我安裝中的實際狀況整合了一下造成下文,共你們學習參考!javascript
1. 安裝和打開 http 和 ssh 的權限
sudo yum install -y curl policycoreutils-python openssh-server
sudo systemctl enable sshd sudo systemctl start sshd sudo firewall-cmd --permanent --add-service=http sudo systemctl reload firewalld
2. 安裝郵件服務 postfix
sudo yum install postfix
sudo systemctl enable postfix sudo systemctl start postfix
使用其餘郵件服務,能夠根據官方文檔自行修改:
https://docs.gitlab.com/omnibus/settings/smtp.htmlhtml
3. 鏡像切換
使用清華大學的鏡像站,地址:https://mirror.tuna.tsinghua.edu.cn/help/gitlab-ce/
3.1. 新建鏡像 repo
新建 /etc/yum.repos.d/gitlab-ce.repo
,內容爲:java
[gitlab-ce]
name=Gitlab CE Repository
baseurl=https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el$releasever/ gpgcheck=0 enabled=1
3.2. 執行命令下載
sudo yum makecache sudo yum install gitlab-ce
4. 配置使用
安裝完成以後,修改Gitlab配置,尤爲是須要修改external_url
,改爲本身使用的 url 地址
vi /etc/gitblab/gitlab.rb
python
external_url='http://xx.xx.xx.xx'
git
5.執行命令配置生效:
gitlab-ctl reconfigure
重啓gitlab:
gitlab-ctl restart
查看gitlab版本:
head -1 /opt/gitlab/version-manifest.txt
6.gitlab漢化segmentfault
Gitlab中文社區版地址:https://gitlab.com/xhang/gitlabruby
#中止gitlabbash
gitlab-ctl stop服務器
6.一、克隆版本庫app
# 如沒安裝git,需提早安裝
yum install -y git
# 建立gitlba漢化包下載目錄
mkdir -p /tmp/gitlab
cd /tmp/gitlab
# 下載最新的漢化包
git clone https://gitlab.com/xhang/gitlab.git
# 若是是要下載老版本的漢化包,須要加上老版本的分支,若是想下載10.0.2,能夠運行以下語句
git clone https://gitlab.com/xhang/gitlab.git -b v10.0.2-zh
#查看漢化版本
cat gitlab/VERSION
6.二、生成英文版和中文版的差別
git diff v11.0.3 v11.0.3-zh > /tmp/11.0.3-zh.diff
patch -d /opt/gitlab/embedded/service/gitlab-rails -p1 < /tmp/11.0.3-zh.diff
https://blog.whsir.com/post-3081.html
https://blog.csdn.net/wh211212/article/details/72627803
https://www.cnblogs.com/straycats/p/7637373.html
https://segmentfault.com/a/1190000014292040?utm_source=index-hottest