RHEL7/CentOS7安装gitlab并汉化

环境CentOS7
本文为CentOS7安装gitlab并汉化文档,来自搭建整理,参考文档为:https://about.gitlab.com/install/

1.安装依赖包
[root@localhost ~]# yum install -y curl policycoreutils-python openssh-server postfix vim wget git patch

2.在系统防火墙中打开HTTP和HTTPS,设置SSH、邮件开机启动
[root@localhost ~]# systemctl restart firewalld
[root@localhost ~]# firewall-cmd --permanent --add-service=http
[root@localhost ~]# firewall-cmd --permanent --add-service=https
[root@localhost ~]# systemctl reload firewalld
[root@localhost ~]# systemctl enable sshd #开机启动
[root@localhost ~]# systemctl start sshd
[root@localhost ~]# systemctl enable postfix #开机启动
[root@localhost ~]# systemctl start postfix

3.下载gitlab/配置YUM源
#用wget下载安装或者直接配置yum安装
[root@localhost home]# wget https://mirror.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-10.0.0-ce.0.el7.x86_64.rpm
[root@localhost home]# vim /etc/yum.repos.d/gitlab.repo #清华大学开源软件镜像站
[gitlab]
name=gitlab
baseurl=https://mirrors.tuna.tsiighua.edu.cn/gitlab-ce/yum/el7/ #根据系统版本配置
repo_gpgcheck=0
gpgcheck=0
enabled=1
gpgkey=https://packages.gitlab.com/gpg.key

4.安装gitlab
[root@localhost home]# yum clean all && yum makecache
[root@localhost home]# yum install -y gitlab-ce-10.0.0-ce.0.el7.x86_64.rpm
[root@localhost home]# vim /etc/gitlab/gitlab.rb #external_url 'http://192.168.2.110'
[root@localhost home]# gitlab-ctl reconfigure #重新配置gitlab
[root@localhost home]# gitlab-ctl status #查看gitlab状态
[root@localhost home]# netstat -tnlp #查看端口

5.中文汉化
[root@localhost home]# cat /opt/gitlab/embedded/service/gitlab-rails/VERSION #查看gitlab版本
[root@localhost home]# gitlab-ctl stop #停止服务
[root@localhost home]# git clone https://gitlab.com/xhang/gitlab.git -b v10.0.0-zh #克隆获取汉化版本库
[root@localhost home]# cat gitlab/VERSION #查看汉化补丁的版本
[root@localhost home]# cd gitlab/
[root@localhost gitlab]# git diff v10.0.0 v10.0.0-zh > ../10.0.0-zh.diff #比较汉化标签和原标签,导出patch用的diff文件到/home下
[root@localhost gitlab]# cd ../
[root@localhost home]# patch -d /opt/gitlab/embedded/service/gitlab-rails -p1 < 10.0.0-zh.diff  #将10.0.0-zh.diff更新到gitlab中
[root@localhost home]# gitlab-ctl reconfigure #重新配置gitlab
[root@localhost home]# gitlab-ctl restart #重启gitlab

6.备注说明
汉化的时候,汉化补丁和gitlab版本尽量保持一致,第一次汉化版本不一致,导致汉化失败。

猜你喜欢

转载自blog.csdn.net/SERE0211/article/details/106646525