大綱
-
部署社區版 Gitlab
- 安裝 Gitlab 依賴項
- 啟動 Postfix, 并設置為開機啟動
- 設置防火墻
- 獲取 Github 的 rpm 包
- 安裝 rpm 包
- 修改配置文件
gitlab.rb
- 重新加載配置內容
-
安裝漢化包
- 安裝 Git
- Git Clone 漢化版本庫
- 查看漢化補丁版本
- 停止 Gitlab 服務
- 切換到 Gitlab 漢化包所在目錄
漢化的
- 比較漢化標簽和原標簽, 導出 patch 用的 diff 文件到 /root 下
- 返回 /root 目錄
- 將 10.0.2-zh.diff 作為補丁更新到 Gitlab 中
- 啟動 Gitlab
- 重新加載配置
-
徹底刪除 Gitlab
- 停止 Gitlab
- 卸載 Gitlab
- 殺死進程
- 刪除文件
1. 部署社區版 Gitlab
1.1. 安裝 Gitlab 依賴項
yum install curl openssh-server openssh-clients postfix cronie policycoreutils-python –y
1.2. 啟動 Postfix, 并設置為開機啟動
systemctl start postfix
systemctl enable postfix
1.3. 設置防火墻
firewall-cmd --add-service=http --permanent
firewall-cmd --reload
1.4. 獲取 Github 的 rpm 包
wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-10.0.2-ce.0.el7.x86_64.rpm
1.5. 安裝 rpm 包
rpm -i gitlab-ce-10.0.2-ce.0.el7.x86_64.rpm
1.6. 修改配置文件 gitlab.rb
cd /etc/gitlab/gitlab.rb
將external_url變量的地址修改為當前機器的ip地址
1.7. 重新加載配置內容
gitlab-ctl reconfigure
gitlab-ctl restart
2. 安裝漢化包
2.1. 安裝 Git
yum install -y git
2.2. Git Clone 漢化版本庫
git clone https://gitlab.com/xhang/gitlab.git
2.3. 查看漢化補丁版本
cat gitlab/VERSION
2.4. 停止 Gitlab 服務
gitlab-ctl stop
2.5. 切換到 Gitlab 漢化包所在目錄 漢化的
cd /root/gitlab
2.6. 比較漢化標簽和原標簽, 導出 patch 用的 diff 文件到 /root 下
git diff v10.0.2 v10.0.2-zh > ../10.0.2-zh.diff
2.7. 返回 /root 目錄
cd
2.8. 將 10.0.2-zh.diff 作為補丁更新到 Gitlab 中
patch -d /opt/gitlab/embedded/service/gitlab-rails -p1 < 10.0.2-zh.diff
2.9. 啟動 Gitlab
gitlab-ctl start
2.10. 重新加載配置
gitlab-ctl reconfigure
3. 徹底刪除 Gitlab
3.1 停止 Gitlab
gitlab-ctl stop
3.2 卸載 Gitlab
rpm -e gitlab-ce
3.3 殺死進程
ps -ef | grep gitlab
kill -9
殺掉第一個(帶好多......的那個)
3.4 刪除文件
find / -name gitlab | xargs rm -rf