CentOS7下搭建GitLabCE9.0.0环境&&汉化

xiaoxiao2021-02-28  67

准备工作

安装依赖 # yum install -y curl policycoreutils openssh-server openssh-clients 设置postfix开机自启、并启动,postfix支持gitlab发信功能 # systemctl enable postfix && systemctl start postfix

安装GitLab

下载安装文件 rpm 文件官方下载地址,根据自己的需要的版本自行下载: https://packages.gitlab.com/gitlab/gitlab-ce上传软件包,并安装 由于我将将软件包放在了/opt路径下,先切换到/opt目录下 # cd /opt # chmod 755 gitlab-ce-9.0.0-ce.0.el7.x86_64.rpm # rpm -ivh gitlab-ce-9.0.0-ce.0.el7.x86_64.rpm

- 至此安装成功


验证安装成果

配置并启动GitLab # gitlab-ctl reconfigure # gitlab-ctl start

提示“ok: run:”表示启动成功

访问 GitLab页面 如果没是默认安装还没有配置,直接输入服务器IP即可进行访问,默认端口80 初始账户: root 密码: 第一次登录设置新的密码 http://localhost

配置GitLab

由于默认为80端口,可能因端口冲突造成启动不成功,下面修改相关配置

修改gitlab配置文件指定服务器ip和自定义端口:

# vi /etc/gitlab/gitlab.rb

设置gitlab发信功能: 发信系统用的默认的postfix,smtp是默认开启的,如果两个都启用了,那么就两个都不会工作. 设置关闭smtp,开启postfix 关闭smtp方法: # vi /etc/gitlab/gitlab.rb

每次重新配置,都需要执行命令gitlab-ctl reconfigure使之生效 # gitlab-ctl reconfigure 配置完成后重启 # gitlab-ctl restart

汉化GitLab

准备工作

停止gitlab # gitlab-ctl stop 查看是否存在Git # git --version

如出现找不到命令“-bash: git: command not found”,执行命令

# git install git 安装依赖 yum -y install patch 查看当前安装版本 # cat /opt/gitlab/embedded/service/gitlab-rails/VERSION 9.0.0

汉化步骤

克隆项目到本地/opt/gitlabhhb路径下 # mkdir -p /opt/gitlabhhb &&cd /opt/gitlabhhb # git clone https://gitlab.com/xhang/gitlab.git 比较汉化标签和原标签,导出 patch 用的 diff 文件.进入刚才的目录git clone 的目录 # cd /opt/gitlabhhb/gitlab # git diff v9.0.0 v9.0.0-zh > ../9.0.0-zh.diff 导入9.0.0-zh.diff文件到 GitLab # patch -d /opt/gitlab/embedded/service/gitlab-rails -p1 < /opt/gitlabhhb/9.0.0-zh.diff 重新配置并启动GitLab # gitlab-ctl reconfigure # gitlab-ctl start
转载请注明原文地址: https://www.6miu.com/read-62879.html

最新回复(0)