环境CentOS7
本文为CentOS7安装gitlab并汉化文档,来自搭建整理,参考文档为:https://about.gitlab.com/install/
1.安装依赖包
yum install -y curl policycoreutils-python openssh-server postfix vim wget git patch
2.在系统防火墙中打开HTTP和HTTPS,设置SSH、邮件开机启动
systemctl restart firewalld
firewall-cmd --permanent --add-service=http
firewall-cmd --permanent --add-service=https
systemctl reload firewalld
systemctl enable sshd
systemctl start sshd
systemctl enable postfix
systemctl start postfix
3.下载gitlab/配置YUM源
用wget下载安装或者直接配置yum安装
# 用wget命令下载gitlab
wget https://mirror.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-10.0.0-ce.0.el7.x86_64.rpm
# 清华大学开源软件镜像站
vim /etc/yum.repos.d/gitlab.repo
[gitlab]
name=gitlab
baseurl=https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/
repo_gpgcheck=0
gpgcheck=0
enabled=1
gpgkey=https://packages.gitlab.com/gpg.key
4.安装gitlab
yum clean all && yum makecache
# 安装gitlab
yum install -y gitlab-ce-10.0.0-ce.0.el7.x86_64.rpm
vim /etc/gitlab/gitlab.rb
# external_url 'http://192.168.2.110'
# 重新配置gitlab
gitlab-ctl reconfigure
# 查看gitlab状态
gitlab-ctl status
# 查看端口
netstat -tnlp
5.中文汉化
# 查看gitlab版本
cat /opt/gitlab/embedded/service/gitlab-rails/VERSION
# 停止服务
gitlab-ctl stop
# 克隆获取汉化版本库,以下我在/home/目录执行的
git clone https://gitlab.com/xhang/gitlab.git -b v10.0.0-zh
# 查看汉化补丁的版本
cat gitlab/VERSION
cd gitlab/
# 比较汉化标签和原标签,导出patch用的diff文件到/home下
git diff v10.0.0 v10.0.0-zh > ../10.0.0-zh.diff
cd ../
# 将10.0.0-zh.diff更新到gitlab中
patch -d /opt/gitlab/embedded/service/gitlab-rails -p1 < 10.0.0-zh.diff
# 重新配置gitlab
gitlab-ctl reconfigure
# 重启gitlab
gitlab-ctl restart
6.备注说明
汉化的时候,汉化补丁和gitlab版本尽量保持一致,第一次汉化版本不一致,导致汉化失败。