- 安装依赖软件
yum -y install policycoreutils openssh-server openssh-clients postfix
2.设置postfix开机自启,并启动,postfix支持gitlab发信功能
systemctl enable postfix && systemctl start postfix
3.下载gitlab安装包,然后安装
centos 7系统的下载地址:https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7
下载:
wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-12.3.5-ce.0.el7.x86_64.rpm
安装:
rpm -i gitlab-ce-12.3.5-ce.0.el7.x86_64.rpm
3、修改gitlab配置文件指定服务器ip和自定义端口:
命令:vim /etc/gitlab/gitlab.rb
external_url ‘http://106.2.20.152:9090’
配置时区
gitlab_rails[‘time_zone’] = ‘Asia/Shanghai’
4、将9090端口添加到防火墙中
命令: firewall-cmd --zone=public --add-port=9090/tcp --permanent
5、重启防火墙
重启命令: systemctl reload firewalld
6、重置gitlab
命令:gitlab-ctl reconfigure
7、启动gitlab
命令:gitlab-ctl restart
启用 Gitlab 开机自启动:
systemctl enable gitlab-runsvdir.service
三、汉化
1、安装git
yum install -y git
2、下载汉化包,其中v12.3.5-zh是版本,我的下载目录是root
git clone https://gitlab.com/xhang/gitlab.git -b v12.3.5-zh
3、停止gitlab服务
gitlab-ctl stop
4、切换到gitlab汉化包所在的目录
cd /root/gitlab
5、比较汉化标签和原标签,导出 patch 用的 diff 文件到/root下
git diff v12.3.5 v12.3.5-zh > …/12.3.5-zh.diff
6、安装patch
yum install patch -y
8、将12.3.5-zh.diff作为补丁更新到gitlab中
patch -d /opt/gitlab/embedded/service/gitlab-rails -p1 < 12.3.5-zh.diff
出现如下直接回车,跳过,这是因为补丁中有一些较新的文件,但是我们安装的gitlab并没有这个文件存在
9、启动gitlab
gitlab-ctl start
10、重新配置gitlab
gitlab-ctl reconfigure