步骤:
yum install -y wget
mv /etc/yum.repos.d /etc/yum.repos.d.backup
mkdir /etc/yum.repos.d
//Linux wget是一个下载文件的工具
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
yum clean all
yum makecache
yum update -y
说明:gitlab中文社区版的项目,v7-v8.8是由Larry Li发起的“GitLab 中文社区版项目”(https://gitlab.com/larryli/gitlab),从 v8.9 之后,@xhang 开始继续该汉化项目(https://gitlab.com/xhang/gitlab)。
yum install -y git
git clone https://gitlab.com/xhang/gitlab.git
git clone https://gitlab.com/xhang/gitlab.git -b v10.0.2-zh
cat gitlab/VERSION
yum install -y curl openssh-server openssh-clients postfix cronie policycoreutils-python
// 10.x以后开始依赖policycoreutils-python,我之前在使用9.x时还没有依赖该项。
systemctl start postfix
systemctl enable postfix
firewall-cmd --add-service=http --permanent
firewall-cmd --reload
//如果提示FirewallD is not running说明防火墙未开启
systemctl start firewalld //通过命令开启
查看清华开源镜像站,有我需要的10.0.2的rpm包。
获取rpm包
wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-10.0.2-ce.0.el7.x86_64.rpm
官方下载:https://packages.gitlab.com/gitlab/gitlab-ce/
因为要在centos7上安装版本10.0.2的gitlab,故找到gitlab-ce-10.0.2-ce.0.el7.x86_64.rpm下载到本地后,通过Bitvise SSH Client工具将rpm包上传到gitlab虚拟机的/root目录下。
说明:从下载速度和方便程度来说,走清华的镜像站的方式更优,但是我2017/10/20想下载gitlab10.0.4时,发现清华的镜像站最新只有10.0.3,故在增补“途径2”获取最新的安装包。
rpm -i gitlab-ce-10.0.2-ce.0.el7.x86_64.rpm
根据提示,继续执行指令配置gitlab。
gitlab-ctl reconfigure
vim /etc/gitlab/gitlab.rb
//将external_url变量的地址修改为gitlab所在centos的ip地址。(因为我这台centos是16.5,故配成图中的地址)
因为修改了配置文件,故需要重新加载配置内容。
gitlab-ctl reconfigure
gitlab-ctl restart
head -1 /opt/gitlab/version-manifest.txt
gitlab-ctl stop
cd /root/gitlab
git diff v10.0.2 v10.0.2-zh > ../10.0.2-zh.diff
cd
yum install patch -y
patch -d /opt/gitlab/embedded/service/gitlab-rails -p1 < 10.0.2-zh.diff
gitlab-ctl start
gitlab-ctl reconfigure
原文出自:https://www.cnblogs.com/straycats/p/7637373.html