CI/CD
在开始玩GitLab之前,你需要的知识储备
- 基本的shell指令,学习传送门
GitLab搭建流程
# 更新软件包
yum update -y
# 安装 sshd
yum install -y curl policycoreutils-python openssh-server
# 启用并启动 sshd
systemctl enable sshd
systemctl start sshd
# 配置防火墙
打开 /etc/sysctl.conf 文件,在文件最后添加新的一行并按 Ctrl + S 保存:
net.ipv4.ip_forward = 1
# 启用并启动防火墙
systemctl enable firewalld
systemctl start firewalld
# 放通 HTTP
firewall-cmd --permanent --add-service=http
# 重启防火墙
systemctl reload firewalld
// tips:在实际使用中,可以使用 systemctl status firewalld 命令查看防火墙的状态。
# 安装 postfix
// GitLab 需要使用 postfix 来发送邮件。
yum install -y postfix
#打开 /etc/postfix/main.cf 文件,在第 119 行附近找到 inet_protocols = all,将 all 改为 ipv4 并按 Ctrl + S 保存:
inet_protocols = ipv4
# 启用并启动 postfix:
systemctl enable postfix
systemctl start postfix
# 配置 swap 交换分区
由于 GitLab 较为消耗资源,我们需要先创建交换分区,以降低物理内存的压力。
在实际生产环境中ÿ