1.获取gitlab汉化包(要部署非汉化版,可以跳过这一块内容)

说明:gitlab中文社区版的项目,v7-v8.8是由Larry Li发起的“GitLab 中文社区版项目”(https://gitlab.com/larryli/gitlab),从 v8.9 之后,@xhang 开始继续该汉化项目
(https://gitlab.com/xhang/gitlab)。

安装git
克隆获取汉化版本库

下载想要的分支:

git clone https://gitlab.com/xhang/gitlab.git -b v11.10.4-zh(最新的是12.3.5)

查看该汉化补丁的版本

cat gitlab/VERSION

2.去清华库下载安装包rpm源码

https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-11.10.4-ce.0.el7.x86_64.rpm

安装必备包:
yum install -y curl openssh-server openssh-clients postfix cronie policycoreutils-python
systemctl start postfix
systemctl enable postfix
安装:
yum install gitlab-ce-11.10.4-ce.0.el7.x86_64.rpm --nogpgcheck
或rpm -ivh gitlab-ce-11.10.4-ce.0.el7.x86_64.rpm(优先)
成功后:
修改配置文件gitlab.rb
vim /etc/gitlab/gitlab.rb
将external_url变量的地址修改为gitlab所在centos的ip地址。
external_url 'http://gitlab.example.com' 》》》 external_url 'http://10.92.190.127:10033'

Advanced settings 下的8080端口 将端口改成自己备用端口号
gitlab-ctl reconfigure

3.汉化

Administrator@800-180329-PC MINGW64 /e/gitlab
$ cat gitlab/VERSION
11.10.4

Administrator@800-180329-PC MINGW64 /e/gitlab
$ git diff v11.10.4 v11.10.4-zh > ../11.10.4-zh.diff
error: Could not access 'v11.10.4'

Administrator@800-180329-PC MINGW64 /e/gitlab
$ cd gitlab/

Administrator@800-180329-PC MINGW64 /e/gitlab/gitlab ((v11.10.4-zh))
$ git diff v11.10.4 v11.10.4-zh > ../11.10.4-zh.diff

 

进入汉化库,我的是在window上克隆下来的,直接运行:git diff v11.10.4 v11.10.4-zh > ../11.10.4-zh.diff
然后把生成的文件传到服务器上


将11.10.4-zh.diff作为补丁更新到gitlab中
yum install patch -y
patch -f -d /opt/gitlab/embedded/service/gitlab-rails -p1 < 11.10.4-zh.diff

gitlab-ctl start
gitlab-ctl reconfigure

4.管理员帐号密码

管理员账号登录的用户名:root
设置管理员密码:浏览器访问gitlab所在的IP,直接写新密码

 

5.卸载

gitlab-ctl stop
rpm -e gitlab-ce
ps -ef|grep gitlab
然后kill掉第一个
删除所有gitlab文件
find / -name gitlab|xargs rm -rf 删除所有包含gitlab的文件及目录
删除gitlab-ctl uninstall时自动在root下备份的配置文件

 

6.补充

在卸载gitlab然后再次安装执行sudo gitlab-ctl reconfigure的时候往往会出现:ruby_block[supervise_redis_sleep] action run,会一直卡无法往下进行!

解决方案:

1、按住CTRL+C强制结束;

2、运行:sudo systemctl restart gitlab-runsvdir;

3、再次执行:sudo gitlab-ctl reconfigure

 

7.11.10.4-zh.diff

 https://files.cnblogs.com/files/CGCong/11.10.4-zh.rar

12.3.5

posted on 2018-08-14 10:48  聪神carry  阅读(267)  评论(0编辑  收藏  举报