gitlab 安裝及漢化
GitLab簡介:
GitLab是一個用於倉庫管理系統的開源項目。使用Git作為代碼管理工具,並在此基礎上搭建起來的Web服務。可通過Web界面進行訪問公開的或者私人項目。它擁有GitHub類似的功能,能夠瀏覽源代碼,管理缺陷和注釋。可以管理團隊對倉庫的訪問,它非常易於瀏覽提交過的版本並提供一個文件歷史庫。團隊成員可以利用內置的簡單聊天程序(Wall)進行交流。它還提供了一個代碼片段收集功能可以輕松實現代碼復用。
常用的網站:
國內鏡像:https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/
Gitlab相關操作及說明:
/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 用於在后台執行隊列任務(異步執行)
安裝gitlab
安裝環境:
(1)CentOS 6或者7 (此處使用7) (2)2G內存(實驗)生產(至少4G),不然會很卡 (3)安裝包:gitlab-ce-10.2.2-ce (4)禁用防火牆,關閉selinux
安裝步驟:
(1)安裝軟件
[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

(2)根據安裝完成提示界面進行訪問URL更改及重新加載配置文件 更改次選項為自己的域名或者IP external_url 'http://gitlab.example.com'
[root@gitlab ~]# vim /etc/gitlab/gitlab.rb #編輯配置文件 external_url 'http://192.168.1.21' #改為自己的IP地址 [root@gitlab ~]# gitlab-ctl reconfigure #重新加載配置文件
(3)重裝完成訪問http://192.168.1.21,會首先叫更改密碼(root用戶),改完后登錄。如下界面:

(4)漢化
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
說明:這里如果使用的同樣是gitlab10.2.2,下載漢化較慢的話,可以直接在這里下載10.2.2-zh.diff。提取碼:kaiw
漢化完成后再次刷新頁面如下

