Linux-GitLab安裝及漢化
阿新 • • 發佈:2021-09-17
GitLab簡介:
GitLab是一個用於倉庫管理系統的開源專案。使用Git作為程式碼管理工具,並在此基礎上搭建起來的Web服務。可通過Web介面進行訪問公開的或者私人專案。它擁有GitHub類似的功能,能夠瀏覽原始碼,管理缺陷和註釋。可以管理團隊對倉庫的訪問,它非常易於瀏覽提交過的版本並提供一個檔案歷史庫。團隊成員可以利用內建的簡單聊天程式(Wall)進行交流。它還提供了一個程式碼片段收集功能可以輕鬆實現程式碼複用。
getlab相關操作及說明
/etc/gitlab/gitlab.rb #gitlab配置檔案
/opt/gitlab #gitlab的程式安裝目錄 /var/opt/gitlab #gitlab目錄資料目錄 /var/opt/gitlab/git-data #存放倉庫資料 gitlab-ctl reconfigure #重新載入配置 gitlab-ctl status #檢視當前gitlab所有服務執行狀態 gitlab-ctl stop #停止gitlab服務 gitlab-ctl stop nginx #單獨停止某個服務 gitlab-ctl tail #檢視所有服務的日誌 Gitlab的服務構成: nginx: 靜態web伺服器 gitlab-workhorse 輕量級反向代理伺服器 logrotate 日誌檔案管理工具 postgresql 資料庫 redis 快取資料庫 sidekiq 用於在後臺執行佇列任務(非同步執行)
安裝步驟
[root@gitlab ~]# yum install -y curl policycoreutils-python openssh-server #安裝依賴 [root@gitlab ~]# wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-10.2.2-ce.0.el7.x86_64.rpm #下載軟體包 [root@gitlab ~]# rpm -ivh gitlab-ce-10.2.2-ce.0.el7.x86_64.rpm #安裝gitlab
修改配置檔案
[root@gitlab ~]# vim /etc/gitlab/gitlab.rb #編輯配置檔案 external_url 'http://192.168.1.21' #改為自己的IP地址 [root@gitlab ~]# gitlab-ctl reconfigure #重新載入配置檔案
git_data_dirs({
"default" => {
"path" => "/data/git-data"
}
})
漢化
1、下載漢化補丁 [root@gitlab ~]# git clone https://gitlab.com/xhang/gitlab.git [root@gitlab ~]# cd gitlab 2、檢視全部分支版本 [root@gitlab ~]# git branch -a 3、對比版本、生成補丁包 [root@gitlab ~]# git diff remotes/origin/10-2-stable remotes/origin/10-2-stable-zh > /tmp/10.2.2-zh.diff 4、停止伺服器 [root@gitlab ~]# gitlab-ctl stop 5、打補丁 [root@gitlab ~]# patch -d /opt/gitlab/embedded/service/gitlab-rails -p1 < /tmp/10.2.2-zh.diff 6、啟動和重新配置 [root@gitlab ~]# gitlab-ctl start [root@gitlab ~]# gitlab-ctl reconfigure