阿里云-云小站(无限量代金券发放中)
【腾讯云】云服务器、云数据库、COS、CDN、短信等热卖云产品特惠抢购

Linux搭建GitLab并汉化

211次阅读
没有评论

共计 1114 个字符,预计需要花费 3 分钟才能阅读完成。

一、环境准备

1.1、下载 wget
1
2
3
4
# yum install -y vim
# yum install -y wget
# cd /usr/local
# wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el6/gitlab-ce-10.0.2-ce.0.el6.x86_64.rpm
1.2、关闭防火墙
1
2
# service iptables stop
# chkconfig iptables off

二、获取 GitLab 汉化包(要部署非汉化版,可以跳过这一块内容)

2.1、安装 Git
1
# yum install -y git
2.2、克隆获取汉化版本库
1
2
# cd /usr/local
# git clone https://gitlab.com/xhang/gitlab.git

三、部署社区版 GitLab

3.1、安装 GitLab 的依赖项
1
# yum -y install policycoreutils openssh-server openssh-clients postfix cronie policycoreutils-python
3.2、启动 postfix,并设置为开机启动
1
2
# service postfix start
# chkconfig postfix on
3.3、安装 rpm 包
1
2
# cd /usr/local
# rpm -ivh gitlab-ce-10.0.2-ce.0.el6.x86_64.rpm
3.4、修改配置文件 gitlab.rb
1
2
3
4
5
# vim /etc/gitlab/gitlab.rb
将 external_url 变量的地址修改为 gitlab 所在 centos 的 ip 地址
修改 GitLab 默认端口

unicorn['port'] = '9092'

因为修改了配置文件,故需要重新加载配置内容。

1
2
# gitlab-ctl reconfigure
# gitlab-ctl restart

四、覆盖汉化包

4.1、停止 GitLab 服务
1
# gitlab-ctl stop
4.2、比较汉化标签和原标签,导出 patch 用的 diff 文件到 /root 下
1
2
# cd /usr/local/gitlab
# git diff v10.0.2 v10.0.2-zh > ../10.0.2-zh.diff
4.3、将 10.0.2-zh.diff 作为补丁更新到 GitLab 中
1
2
3
4
5
6
# cd /usr/local
# yum install patch -y
# patch -d /opt/gitlab/embedded/service/gitlab-rails -p1 < 10.0.2-zh.diff
Tips: 重启 GitLab
# gitlab-ctl reconfigure
# gitlab-ctl restart

正文完
星哥说事-微信公众号
post-qrcode
 0
星锅
版权声明:本站原创文章,由 星锅 于2022-10-11发表,共计1114字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。
【腾讯云】推广者专属福利,新客户无门槛领取总价值高达2860元代金券,每种代金券限量500张,先到先得。
阿里云-最新活动爆款每日限量供应
评论(没有评论)
验证码
【腾讯云】云服务器、云数据库、COS、CDN、短信等云产品特惠热卖中