GitLab 社區版安裝與漢化方法

1、GitLab 安裝

1.1 安裝並配置必要的依賴關係

在 CentOS 系統上,下面的命令將會打開系統防火牆 HTTP 和 SSH 的訪問。

yum install -y curl policycoreutils-python openssh-server
systemctl enable sshd
systemctl start sshd
firewall-cmd --permanent --add-service=http
systemctl reload firewalld

使用 Postfix 發送郵件

yum install postfix
systemctl enable postfix
systemctl start postfix

1.2 添加 GitLab 鏡像源並安裝

添加鏡像源,或手動下載安裝包

curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | bash

安裝

yum install -y gitlab-ce

如果爲下載的rpm包,使用如下命令安裝

rpm -i gitlab-ce-XXX.rpm

1.3 修改地址

vim /etc/gitlab/gitlab.rb

external_url改爲對應的地址和端口

1.4 配置並啓動 GitLab

gitlab-ctl reconfigure

1.5 通過瀏覽器訪問上一步配置的域名

系統默認的管理員賬號爲 root, 第一次訪問 GitLab,系統會重定向 url 到重置密碼的頁面,需要輸入初始化管理員賬號的密碼。 設置完成後,系統會重定向到登錄界面,你就可以使用剛纔輸入的密碼登錄系統了。

2、GitLab 漢化

2.1 確認當前版本

cat /opt/gitlab/embedded/service/gitlab-rails/VERSION

假設當前版本爲 v10.1.1,並確認漢化版本庫是否包含該版本的漢化標籤(-zh結尾),也就是是否包含v10.1.1-zh。

2.2 在本地 clone 倉庫

git clone https://gitlab.com/xhang/gitlab.git    # 克隆漢化版本庫
git fetch    # 如果已經克隆過,則進行更新

2.3 比較漢化標籤和原標籤,導出 patch 用的 diff 文件

cd gitlab
git diff v10.1.1 v10.1.1-zh > ../v10.1.1-zh.diff

2.4 上傳v10.1.1-zh.diff 文件到服務器

gitlab-ctl stop
patch -d /opt/gitlab/embedded/service/gitlab-rails -p1 < v10.1.1-zh.diff

2.5 確定沒有 .rej 文件,重啓 GitLab 即可

gitlab-ctl start

2.6 執行重新配置命令

gitlab-ctl reconfigure

原文連接:https://about.gitlab.com/installation/#centos-7
參考鏈接:GitLab 安裝方法    GitLab 中文社區版

發佈了35 篇原創文章 · 獲贊 39 · 訪問量 30萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章