一 部署社区版gitlab
1.1 安装gitlab的依赖项
yum install curl openssh-server openssh-clients postfix cronie policycoreutils-python –y
1.2 启动postfix,并设置为开机启动
systemctl start postfix systemctl enable postfix1.3 设置防火墙
firewall-cmd --add-service=http --permanent firewall-cmd --reload1.4 获取gitlab的rpm包
查看清华开源镜像站,有我需要的8.6.7的rpm包
获取rpm包
wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-8.6.7-ce.0.el7.x86_64.rpm
安装rpm包
rpm -ivh gitlab-ce-8.6.7-ce.0.el7.x86_64.rpm1.5 修改配置文件gitlab.rb
vim /etc/gitlab/gitlab.rb
因为修改了配置文件,故需要重新加载配置内容。
gitlab-ctl reconfiguregitlab-ctl restart
二、获取gitlab汉化包(要部署非汉化版,可以跳过这一块内容)
说明:gitlab中文社区版的项目,v7-v8.8是由Larry Li发起的“GitLab 中文社区版项目”(https://gitlab.com/larryli/gitlab),从 v8.9 之后,@xhang 开始继续该汉化项目(https://gitlab.com/xhang/gitlab)。
2.1 安装git
yum install -y git
2.2 克隆获取汉化版本库
git clone https://gitlab.com/xhang/gitlab.git// 如果已经克隆过,则进行更新(第一次部署不用更新)
git fetch
2.3 查看该汉化补丁的版本
cat gitlab/VERSION三、汉化
1,切换分支。这里centos7测试的是8.6.7版本,需要进行切换。
- cd gitlab-L-zh
- git checkout -b 8-6-zh origin/8-6-zh
- cp -r /opt/gitlab/embedded/service/gitlab-rails{,.ori}
3,汉化操作
首先停止gitlab:
- gitlab-ctl stop
汉化操作:
- yes|cp -rf ../gitlab-L-zh/* /opt/gitlab/embedded/service/gitlab-rails/
4,启动,查看效果
- gitlab-ctl start