GitLab
一、GitLab安装部署
1.环境准备
sshd服务
sudo yum install -y curl policycoreutils-python openssh-server
sudo systemctl enable sshd
sudo systemctl start sshd
邮件服务
sudo yum install postfix
sudo systemctl enable postfix
sudo systemctl start postfix
2.从官网获取安装脚本
当然自己手动安装也是可以的gitlab下载地址,使用官网脚本会简单一些。执行这一步会如果使用CentOS系统,会添加gitlab的yum源
//输出到文件里是为了看下下载的脚本内容
curl https://packages.gitlab.com/install/reposiories/gitlab/gitlab-ee/script.rpm.sh > rpm.sh
chmod +x rpm.sh
./rpm.sh
3.安装gitlab
//使用yum安装gitlab
yum install -y gitlab-ee
//可以看下gitlab-ee包的内容,看到gitlab安装在/opt/gitlab目录下
rpm -ql gitlab-ee | less
4.配置gitlab
官方配置文档https://docs.gitlab.com/omnibus/settings/configuration.html
5.汉化配置
停止运行
gitlab-ctl stop
安装git
先启用EPEL存储库
RHEL/CentOS 7 64位执行以下命令:
wget http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -ivh epel-release-latest-7.noarch.rpm
RHEL/CentOS 7 32位执行以下
wget http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
rpm -ivh epel-release-6-8.noarch.rpm
安装git命令
yum install -y git
下载汉化包
git clone https://gitlab.com/xhang/gitlab.git
切换到汉化包所在目录
比较汉化标签和原标签,导出 patch 用的 diff 文件到/root下
git diff v11.1.6 v11.1.6-zh > ../11.1.6-zh.diff
将diff文件作为补丁更新到gitlab中
yum install patch -y
patch -d /opt/gitlab/embedded/service/gitlab-rails -p1 < 11.1.6-zh.diff
7.设置发邮件功能
修改配置文件,配置发件邮箱和发信人
vim /etc/gitlab/gitlab.rb
8.运行gitlab
gitlab-ctl start
gitlab-ctl reconfigure