Gitlab 10.1.4 (汉化版) for CentOS 7.4安装

来源:互联网 发布:软件竣工总结报告 编辑:程序博客网 时间:2024/05/21 04:22
源代码是一个软件公司最重要的资产。源代码的管理经历了中心化的cvs, svn到git的过程。
原先git server采用的是gitolite (https://github.com/sitaramc/gitolite) ,现在已迁移到gitlab。


部署环境
CentOS 7.4 64位

开始安装Gitlab v10.1.4
yum install -y curl policycoreutils-python openssh-server openssh-clients
如果服务器已经安装并运行OpenSSH,那么不用执行以下命令
systemctl enable sshd
systemctl start sshd
如果服务器已经关闭防火墙或者添加相关规则,那么不用执行以下命令
firewall-cmd --permanent --add-service=http
systemctl reload firewalld
安装开源邮件服务器postfix
yum install postfixsystemctl enable postfixsystemctl start postfix
向本机添加gitlab的仓库
curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | bash
EXTERNAL_URL="http://gitlab.cssweb.com" yum install -y gitlab-ce
此处把EXTERNAL_URL设成ip地址或域名,如果没有DNS服务器,记得在自己的电脑中找到hosts文件并添加相关映射(此处不展开了)。


如果安装过程中没有配置EXTERNAL_URL, 可以在上述命令执行后,编辑/etc/gitlab/gitlab.rb修改配置信息。
置gitlab
gitlab-ctl reconfigure
查看gitlab的版本
rpm -qa | grep gitlab
或者head -1 /opt/gitlab/version-manifest.txt

Gitlab的汉化
停止gitlab
gitlab-ctl stop

下载gitlab版本对应的汉化包
git clone https://gitlab.com/xhang/gitlab.git -b v10.1.4-zh
cd gitlab
导出patch用的diff文件
git diff v10.1.4 v10.1.4-zh > v10.1.4-zh.diff
yum install patch
执行以下命令前,可以对目录/opt/gitlab/embedded/service/gitlab-rails做一下备份
打补丁
patch -d /opt/gitlab/embedded/service/gitlab-rails -p1 < v10.1.4-zh.diff
重新配置
gitlab-ctl reconfigure
启动gitlab
gitlab-ctl restart

访问gitlab



首次会要求设置root用户的密码。


修改密码后,就可以登录系统。



参考资料
https://about.gitlab.com/installation/#centos-7?version=ce
https://gitlab.com/xhang/gitlab
https://github.com/marbleqi/gitlab-ce-zh