系统运维
环境centos7,内存至少4G,Gitlab还是挺耗内存的。
GitHub安装参考:https://about.gitlab.com/install/
组件安装参考:https://docs.gitlab.com/ce/development/architecture.html
安装
配置Yum源
使用国内的软件镜像站,这里使用清华大学开源软件镜像站。
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
安装
安装相关依赖
yum install curl policycoreutils-python openssh-server
然后执行更新包缓存并安装
yum makecache
yum install gitlab-ce
当安装最后出现一只狐狸头像时,说明安装成功。
启动配置
目录结构
/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\' #时区
unicorn[\'worker_processes\'] = 4 #依据服务器CPU核数
nginx[\'listen_port\'] = 80 #默认Nginx端口80,这里使用gitlab已有的Nginx服务,当然也可使用自己安装的Nginx服务。
修改完配置后需执行,使配置重新加载:
gitlab-ctl reconfigure
gitlab启动:gitlab-ctl start
gitlab查看状态: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默认用户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
执行安装patch如果出现如下问题,直接跳过,即一直回车跳过。是因为补丁包有一些较新的补丁文件,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。
分享名称:Centos7安装部署汉化Gitlab
文章转载:https://www.cdcxhl.com/article32/cggdpc.html
成都网站建设公司_创新互联,为您提供微信公众号、静态网站、面包屑导航、定制网站、App开发、做网站
声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联