一、安装依赖
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 firewall-cmd --permanent --add-service=https
sudo systemctl reload firewalld
二、选择安装邮件服务
sudo yum install postfix
sudo systemctl enable postfix
sudo systemctl start postfix
三、安装gitlab-ce仓库和安装包
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash
四、安装gitlab
信任gitlab公钥
curl https://packages.gitlab.com/gpg.key 2> /dev/null | sudo apt-key add - &>/dev/null
使用清华大学镜像
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
yum makecache
sudo EXTERNAL_URL="http://192.168.159.133" yum install -y gitlab-ce
EXTERNAL_URL后面为域名或者主机
五、gitlab配置文件
/etc/gitlab/gitlab.rb
六、其他相关命令
如修改配置文件后,重载配置:gitlab-ctl reconfigure
重启:gitlab-ctl restart
开机启动:systemctl enable gitlab-runsvdir.service
禁止开机启动:systemctl disable gitlab-runsvdir.service
七、访问
使用之前的EXTERNAL_UR访问,并注册账号和密码(初次)
八、卸载
sudo gitlab-ctl stop
sudo rpm -e gitlab-ce
ps aux | grep gitlab 查看进程,杀掉第一个守护进程
find / -name gitlab | xargs rm -rf 删除所有包含gitlab文件