Linux-GitLab安装及汉化
安装步骤:
(1)安装软件
1> 安装依赖
1 [root@centos7-test packages]# yum install -y curl policycoreutils-python openssh-server
2>下载软件包
1 [root@centos7-test packages]# wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-10.2.2-ce.0.el7.x86_64.rpm
3>
1 [root@centos7-test packages]# rpm -ivh gitlab-ce-10.2.2-ce.0.el7.x86_64.rpm
安装效果
1 [root@centos7-test packages]# rpm -ivh gitlab-ce-10.2.2-ce.0.el7.x86_64.rpm 2 警告:gitlab-ce-10.2.2-ce.0.el7.x86_64.rpm: 头V4 RSA/SHA1 Signature, 密钥 ID f27eab47: NOKEY 3 准备中... ################################# [100%] 4 正在升级/安装... 5 1:gitlab-ce-10.2.2-ce.0.el7 ################################# [100%] 6 It looks like GitLab has not been configured yet; skipping the upgrade script. 7 8 *. *. 9 *** *** 10 ***** ***** 11 .****** ******* 12 ******** ******** 13 ,,,,,,,,,***********,,,,,,,,, 14 ,,,,,,,,,,,*********,,,,,,,,,,, 15 .,,,,,,,,,,,*******,,,,,,,,,,,, 16 ,,,,,,,,,*****,,,,,,,,,. 17 ,,,,,,,****,,,,,, 18 .,,,***,,,, 19 ,*,. 20 21 22 23 _______ __ __ __ 24 / ____(_) /_/ / ____ _/ /_ 25 / / __/ / __/ / / __ \`/ __ \ 26 / /_/ / / /_/ /___/ /_/ / /_/ / 27 \____/_/\__/_____/\__,_/_.___/ 28 29 30 Thank you for installing GitLab! 31 GitLab was unable to detect a valid hostname for your instance. 32 Please configure a URL for your GitLab instance by setting `external_url` 33 configuration in /etc/gitlab/gitlab.rb file. 34 Then, you can start your GitLab instance by running the following command: 35 sudo gitlab-ctl reconfigure 36 37 For a comprehensive list of configuration options please see the Omnibus GitLab readme 38 https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md 39 40 [root@centos7-test packages]# 41
(2)根据安装完成提示界面进行访问URL更改及重新加载配置文件 更改次选项为自己的域名或者IP external_url 'http://gitlab.example.com'
1 [root@centos7-test packages]# vim /etc/gitlab/gitlab.rb
如图将 external_url 改为自己的IP地址
重新加载配置文件
1 [root@centos7-test packages]# gitlab-ctl reconfigure
重新加载配置 可能会报错
要修改 external_url '192.168.145.130' 变成 external_url = '192.168.145.130'
修改完后 重新加载配置
(3)重装完成访问http://192.168.145.130,会首先叫更改密码(root用户),改完后登录。如下界面:
3)重装完成访问http://192.168.1.21,会首先叫更改密码(root用户),改完后登录。如下界面:
(4)汉化
1 1、下载汉化补丁 2 [root@centos7-test packages]# git clone https://gitlab.com/xhang/gitlab.git 3 [root@centos7-test packages]# cd gitlab 4 2、查看全部分支版本 5 [root@centos7-test]# git branch -a 6 3、对比版本、生成补丁包 7 [root@centos7-test]# git diff remotes/origin/10-2-stable remotes/origin/10-2-stable-zh > /tmp/10.2.2-zh.diff 8 4、停止服务器 9 [root@centos7-test]# gitlab-ctl stop 10 5、打补丁 11 [root@centos7-test]# patch -d /opt/gitlab/embedded/service/gitlab-rails -p1 < /tmp/10.2.2-zh.diff 12 6、启动和重新配置 13 [root@centos7-test]# gitlab-ctl start 14 [root@centos7-test]# gitlab-ctl reconfigure
汉化完成后再次刷新页面如下
归类: 自动化运维及相关服务