在VM上用linux虚拟机搭建汉化-gitlab服务器

116 阅读1分钟

安装所需依赖

 sudo yum install -y curl policycoreutils-pythonopenssh-server

ssh设置为开机自启动

sudo systemctl enable sshd

启动ssh

sudo systemctl start sshd

启动防火墙

systemctl status firewalld

将http加到服务,并设置永久有效

sudo firewall-cmd --permanent --add-service=http

重启防火墙

sudo systemctl reload firewalld

安装Postfix以发送邮件

sudo yum install postfix

设置Postfix服务为自启动

sudo systemctl enable postfix

启动服务

sudo systemctl start postfix

查看wget应用

wget -V

安装vim编辑器

yum install vim -y

添加gitlab镜像对应centos版本

wget --no-check-certificate  https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-10.0.0-ce.0.el7.x86_64.rpm

安装gitlab

su root
rpm -ivh gitlab-ce-10.0.0-ce.0.el7.x86_64.rpm

编辑gitlab配置文件

注意端口是否被占用

vim  /etc/gitlab/gitlab.rb
----------
http://192.168.10.106:8088

重置并启动gitlab

gitlab-ctl reconfigure
-------------显示
Running handlers:
Running handlers complete
Chef Client finished, 362/515 resources updated in 03 minutes 06 seconds
gitlab Reconfigured!

/etc/gitlab/initial_root_password文件为暂存的密码(我安装没这个文件)

cd /etc/gitlab/initial_root_password

重置密码

su git
user = User.where(id:1).first----用户为超级管理员:root
user.password='Admin@123'-----(密码要八位)
user.save! 

gitlab客户端汉化步骤

安装git

wget http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
------------
yum install -y git

克隆gitlab汉化仓库

git clone https://gitlab.com/xhang/gitlab.git

查看自己的gitlab版本号

 head -1 /opt/gitlab/version-manifest.txt
 :gitlab-ce 10.0.0
​

进入gitlab目录

cd gitlab

生产对比文件

git diff v10.0.0 v10.0.0-zh  > ../v10.0.0-zh.diff

安装patch

yum install -y patch

停止gitlab

gitlab-ctl stop

导入补丁

patch -d /opt/gitlab/embedded/service/gitlab-rails -p1 <  ../v10.0.0-zh.diff

启动gitlab

gitlab-ctl start
gitlab-ctl reconfigure