共计 1114 个字符,预计需要花费 3 分钟才能阅读完成。
一、环境准备
1.1、下载 wget
1234
|
# 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、关闭防火墙
12 |
# service iptables stop# chkconfig iptables off
|
二、获取 GitLab 汉化包(要部署非汉化版,可以跳过这一块内容)
2.1、安装 Git
1 |
# yum install -y git
|
2.2、克隆获取汉化版本库
12 |
# 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,并设置为开机启动
12 |
# service postfix start# chkconfig postfix on
|
3.3、安装 rpm 包
12 |
# cd /usr/local# rpm -ivh gitlab-ce-10.0.2-ce.0.el6.x86_64.rpm
|
3.4、修改配置文件 gitlab.rb
12345 |
# vim /etc/gitlab/gitlab.rb将 external_url 变量的地址修改为 gitlab 所在 centos 的 ip 地址 修改 GitLab 默认端口unicorn['port'] = '9092'
|
因为修改了配置文件,故需要重新加载配置内容。
12 |
# gitlab-ctl reconfigure# gitlab-ctl restart
|
四、覆盖汉化包
4.1、停止 GitLab 服务
1 |
# gitlab-ctl stop
|
4.2、比较汉化标签和原标签,导出 patch 用的 diff 文件到 /root 下
12 |
# 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 中
123456 |
# cd /usr/local# yum install patch -y# patch -d /opt/gitlab/embedded/service/gitlab-rails -p1 < 10.0.2-zh.diffTips: 重启 GitLab# gitlab-ctl reconfigure# gitlab-ctl restart
|
正文完
星哥玩云-微信公众号
