一蝴蜓、環(huán)境準(zhǔn)備
1.1 下載wget
? ? yum install -y vim
? ? yum install -y wget
? ? cd /usr/local
? ? wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-11.1.6-ce.0.el7.x86_64.rpm
1.2 關(guān)閉防火墻
? ? CentOS 7.0默認(rèn)使用的是firewall作為防火墻
? ? 停止firewall
? ? systemctl stop firewalld.service
? ? 禁止firewall開機(jī)啟動(dòng)
? ? systemctl disable firewalld.service
? ? 查看防火墻狀態(tài)
? ? firewall-cmd? --state? (not running為關(guān)閉碟绑,running為開啟)
二、獲取GitLab漢化包(要部署非漢化版茎匠,可以跳過這一塊內(nèi)容)
2.1 安裝Git
? ? yum install -y git
2.2 克隆獲取漢化版本庫
? ? cd /usr/local
? ? git clone https://gitlab.com/xhang/gitlab.git
三格仲、部署社區(qū)版GitLab
3.1 安裝GitLab的依賴項(xiàng)
? ? yum -y install policycoreutils openssh-server openssh-clients postfix cronie policycoreutils-python
3.2 啟動(dòng)postfix,并設(shè)置為開機(jī)啟動(dòng)
? ? service postfix start
? ? chkconfig postfix on
3.3 安裝rpm包
? ? cd /usr/local
? ? rpm -ivh gitlab-ce-11.1.6-ce.0.el7.x86_64.rpm
3.4 修改配置文件gitlab.rb
? ? vim /etc/gitlab/gitlab.rb
? ? 將external_url變量的地址修改為gitlab所在centos的ip地址 eg:external_url 'http://192.168.157.128:9092'
? ? 因?yàn)樾薷牧伺渲梦募忻埃市枰匦录虞d配置內(nèi)容
? ? gitlab-ctl reconfigure
? ? gitlab-ctl restart
四凯肋、覆蓋漢化包
4.1 停止GitLab服務(wù)
? ? gitlab-ctl stop
4.2 比較漢化標(biāo)簽和原標(biāo)簽,導(dǎo)出 patch 用的 diff 文件到/root下
? ? cd /usr/local/gitlab
? ? git diff v11.1.6 v11.1.6-zh > ../11.1.6-zh.diff
4.3 將10.0.2-zh.diff作為補(bǔ)丁更新到GitLab中
? ? cd /usr/local
? ? yum install patch -y
? ? patch -d /opt/gitlab/embedded/service/gitlab-rails -p1 < 11.1.6-zh.diff
? ? 回車覆蓋
? ? gitlab-ctl reconfigure
? ? gitlab-ctl restart
gitlab倉庫存儲(chǔ)位置的修改方法
例如我這里把數(shù)據(jù)存放到/data/gitlab目錄下
1.創(chuàng)建/data/gitlab目錄 mkdir -p /data/gitlab
2.修改配置文件路徑 vim /etc/gitlab/gitlab.rb
? ? git_data_dirs({
? ? "default" => {
? ? ? "path" => "/data/gitlab"
? ? }
? })
3.停止當(dāng)前gitlab汽馋,重新加載配置
? gitlab-ctl stop
? gitlab-ctl reconfigure