转自我的个人博客http://mistariano.com/blog/9
1. 服务器上安装 gitlab-runner
参考博客https://blog.csdn.net/qq_40699305/article/details/82753506
# 添加仓库到源
curl -L https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.rpm.sh | sudo bash
# 安装
sudo yum install gitlab-runner -y
# 注册 gitlab-runner
#
# 注册时需要的URL和Token可在仓库配置中找到
# 比如OO课程GitLab的URL是https://gitlab.buaaoo.top/
# 提示输入Tag时,为了方便测试起见建议留空
# Executor可以看情况选,我的服务器比较烂所以就不配docker了,直接填shell
sudo gitlab-runner register
# 修改文件权限
sudo chown -R gitlab-runner:gitlab-runner /home/gitlab-runner
sudo chmod -R 777 /home/gitlab-runner
# 启动服务
gitlab-runner start
# 检查状态
gitlab-runner list
gitlab-runner status