一、配置 gitlab 的 yum 源
1 2 3 4 5 6 7 |
vim /etc/yum.repos.d/gitlab-ce.repo [gitlab-ce] name=Gitlab CE Repository baseurl=https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el$releasever/ gpgcheck=0 enabled=1 |
二、安装依赖,并在系统防火墙进行 HTTP 和 SSH 配置
1 2 3 4 5 |
sudo yum install -y curl policycoreutils-python openssh-server sudo systemctl enable sshd sudo systemctl start sshd sudo firewall-cmd --permanent --add-service=http sudo systemctl reload firewalld |
三、配置邮件通知(可选)
1 2 3 |
sudo yum install postfix sudo systemctl enable postfix sudo systemctl start postfix |
四、添加 gitlab 包仓储
1 |
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash |
五、安装 gitlab
1 |
sudo yum install -y gitlab-ce |
参考:
https://about.gitlab.com/install/#centos-7
https://www.cnblogs.com/weifeng1463/p/7714492.html