您好,登錄后才能下訂單哦!
環(huán)境centos7,內(nèi)存至少4G,Gitlab還是挺耗內(nèi)存的。
GitHub安裝參考:https://about.gitlab.com/install/
組件安裝參考:https://docs.gitlab.com/ce/development/architecture.html
安裝
配置Yum源
使用國內(nèi)的軟件鏡像站,這里使用清華大學(xué)開源軟件鏡像站。
cat /etc/yum.repos.d/tsinghua.repo
[gitlab-ce]
name=Gitlab CE Repository
baseurl=https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el$releasever/
gpgcheck=0
enabled=1
安裝
安裝相關(guān)依賴
yum install curl policycoreutils-python openssh-server
然后執(zhí)行更新包緩存并安裝
yum makecache
yum install gitlab-ce
當(dāng)安裝最后出現(xiàn)一只狐貍頭像時,說明安裝成功。
啟動配置
目錄結(jié)構(gòu)
/opt/gitlab 主目錄
/etc/gitlab/ 配置文件目錄
/var/log/gitlab/ 日志目錄
修改配置
vim /etc/gitlab/gitlab.rb
external_url 'http://10.10.10.55' #這如果nginx 修改端口,external_url 里面也必須帶端口
gitlab_rails['time_zone'] = 'Asia/Shanghai' #時區(qū)
unicorn['worker_processes'] = 4 #依據(jù)服務(wù)器CPU核數(shù)
nginx['listen_port'] = 80 #默認(rèn)Nginx端口80,這里使用gitlab已有的Nginx服務(wù),當(dāng)然也可使用自己安裝的Nginx服務(wù)。
修改完配置后需執(zhí)行,使配置重新加載:
gitlab-ctl reconfigure
gitlab啟動:gitlab-ctl start
gitlab查看狀態(tài):gitlab-ctl status
run: alertmanager: (pid 28348) 10561s; run: log: (pid 16612) 18335s
run: gitaly: (pid 28362) 10561s; run: log: (pid 16611) 18335s
run: gitlab-exporter: (pid 28383) 10560s; run: log: (pid 16617) 18335s
run: gitlab-workhorse: (pid 28398) 10560s; run: log: (pid 16604) 18335s
run: grafana: (pid 28407) 10559s; run: log: (pid 16621) 18335s
run: logrotate: (pid 9348) 3359s; run: log: (pid 16616) 18335s
run: nginx: (pid 28426) 10559s; run: log: (pid 16613) 18335s
run: node-exporter: (pid 28510) 10558s; run: log: (pid 16619) 18335s
run: postgres-exporter: (pid 28516) 10558s; run: log: (pid 16618) 18335s
run: postgresql: (pid 28523) 10557s; run: log: (pid 16615) 18335s
run: prometheus: (pid 28532) 10557s; run: log: (pid 16599) 18335s
run: redis: (pid 28550) 10556s; run: log: (pid 16596) 18335s
run: redis-exporter: (pid 28554) 10556s; run: log: (pid 16605) 18335s
run: sidekiq: (pid 28563) 10556s; run: log: (pid 16614) 18335s
run: unicorn: (pid 28569) 10555s; run: log: (pid 16603) 18335s
登錄Gitlab
Gitlab默認(rèn)用戶root,第一次登錄提示修改密碼
git clone https://gitlab.com/xhang/gitlab.git
2.查看clone下載漢化本補丁版本
# cat /opt/src/gitlab/VERSION
12.3.5
3.停止gitlab
gitlab-ctl stop
4.查看已安裝的版本:
head -1 /opt/gitlab/version-manifest.txt
gitlab-ce 12.4.2
5.獲取漢化包:
cd /opt/src/gitlab
git diff origin/12.3.5-stable origin/12.3.5-stable-zh > /tmp/12.3.5.diff
6.更新補丁到gitlab中:
# yum -y install patch
cd /tmp/
#patch -d /opt/gitlab/embedded/service/gitlab-rails -p1 < 12.3.5.diff
執(zhí)行安裝patch如果出現(xiàn)如下問題,直接跳過,即一直回車跳過。是因為補丁包有一些較新的補丁文件,gitlab上沒有這些文件。
can't find file to patch at input line 5
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
|diff --git a/app/assets/javascripts/awards_handler.js b/app/assets/javascripts/awards_handler.js
|index 976d32a..7967edb 100644
|--- a/app/assets/javascripts/awards_handler.js
|+++ b/app/assets/javascripts/awards_handler.js
7.重新加載配置并啟動Gitlab:
gitlab-ctl reconfigure & gitlab-ctl start
重新登錄Gitlab。
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。