Gitlab rpm安装以及汉化

Gitlab rpm安装以及汉化

环境 linux-centos (7.3)

GitLab是一个私有的Git仓库,具有较好的项目管理和用户管理能力。
官方安装文档连接:https://about.gitlab.com/installation/

一、安装依赖包、下载安装gitlab rpm包

  1. 因为Gitlab的业务上需要发送邮件功能,所以在安装Gitlab前要先安装postfix.
yum install curl openssh-server postfix cronie 
yum -y install policycoreutils-python   #必须安装该依赖包

下载安装gitlab rpm包

wget --content-disposition https://packages.gitlab.com/gitlab/gitlab-ce/packages/el/7/gitlab-ce-10.8.4-ce.0.el7.x86_64.rpm/download.rpm

rpm -ivh gitlab-ce-10.8.4-ce.0.el7.x86_64.rpm

注:如果网络不稳定 也可使用清华开源软件镜像站网站下载所需版本

https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el6/            #centos6 
https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/            #centos7

#安装完成会出现gitlab的logo
这里写图片描述
2. 修改gitlab的url并执行reconfigure

vi /etc/gitlab/gitlab.rb

···
external_url 'http://192.168.1.22'

vim

gitlab-ctl reconfigure #这一步时间较长 耐心等候

这里写图片描述
3. web 界面登录
8.8版本之前默认账号 root 密码 5iveL!fe
8.9之后登录web界面会要求更改密码,注意密码最少8位!!
如忘记密码可在gitlab数据库修改密码文档链接:https://blog.csdn.net/qq_40025218/article/details/81363126
web

二、 汉化包下载 安装配置

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

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

克隆汉化补丁仓库

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

查看gitlab版本 diff 获取对应版本的中文补丁

head -1 /opt/gitlab/version-manifest.txt     #安装的是gitlab-ce 10.8.4版
cd gitlab                                        #进入刚才clone下来的gitlab目录
git diff v10.8.4 v10.8.4-zh  > /root/v10.8.4-zh.diff   #用diff将英文原版与中文版的对比生成.diff文件

将中文补丁导入gitlab

gitlab-ctl stop           #停止gitlab
patch -d /opt/gitlab/embedded/service/gitlab-rails -p1 <  ../v10.8.4-zh.diff  
                                      #将刚才的diff文件做为补丁导入到gitlab中
                                      #patch若不能用 请安装 yum install -y patch
gitlab-ctl start         #启动gitlab
gitlab-ctl reconfigure   #若访问web出现502 可重新配置 在访问

在打包补丁 patch -d /opt/gitlab/embedded/service/gitlab-rails -p1 < ../v10.8.4-zh.diff
后可能会出来该情况 一路回车跳过即可!

[root@web1 ]#patch -d /opt/gitlab/embedded/service/gitlab-rails -p1 < v10.8.4-zh.diff
can't find file to patch at input line 5
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/app/assets/javascripts/awards_handler.js b/app/assets/javascripts/awards_handler.js
|index 976d32a..7967edb 100644
|--- a/app/assets/javascripts/awards_handler.js
|+++ b/app/assets/javascripts/awards_handler.js
--------------------------
File to patch: 

这里写图片描述
这里写图片描述

参考连接

https://about.gitlab.com/installation/#centos-7
http://blog.51cto.com/bigboss/2129284

猜你喜欢

转载自blog.csdn.net/qq_40025218/article/details/81360794
今日推荐