您的位置:首页 > 博客中心 > 互联网 >

centos gitlab部署

时间:2022-05-11 13:02

依赖安装

# 在CentOS系统上安装所需的依赖:ssh,防火墙,postfix(用于邮件通知) ,wget,以下这些命令也会打开系统防火墙中的HTTP和SSH端口访问。
yum install curl openssh-server openssh-clients postfix cronie -y

下载安装gitlab

wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el8/gitlab-ce-13.6.3-ce.0.el8.x86_64.rpm
rpm -ivh gitlab-ce-13.6.3-ce.0.el8.x86_64.rpm

出现如图则代表安装成功
技术图片

配置

# 替换域名
sed -i  s"#external_url.*#external_url ‘http://gitlab.maerxin.cn‘#"  /etc/gitlab/gitlab.rb
# 重置启动gitlab
gitlab-ctl reconfigure
gitlab-ctl restart
# 加入开机自启
systemctl enable gitlab-runsvdir.service
# 开放防火墙
firewall-cmd --permanent --add-service=http
firewall-cmd --reload

runner 配置

runner一般不跟gitlab放在同一台机器上,安装过程参考gitlab官方文档,毕竟每个系统的安装方式是有差异的。
安装好之后执行如下命令将runner注册给gitlab,命令是交互式的,很好懂。

wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-runner/yum/el8/gitlab-runner-13.6.0-1.x86_64.rpm
rpm -ivh gitlab-runner-13.6.0-1.x86_64.rpm
# 注册
gitlab-runner register

技术图片

本类排行

今日推荐

热门手游