1、安装# 下载可执行文件curl -L --output /usr/local/bin/gitlab-runner https://gitlab-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-runner-linux-amd64# 添加可执行权限chmod 777 /usr/local/bin/gitlab-runner# 添加软链ln -snf /usr/local/bin/gitlab-runner /usr/bin/gitlab-runner# 生成工作目录mkdir /srv/runner# 用root权限运行,避免权限问题gitlab-runner install --user=root --working-directory=/srv/runner# 安装相关工具yum install -y tcl-develyum install -y expect# 启动服务gitlab-runner start# 注册runnergitlab-runner register --url https://gitlab.com/ --registration-token 注册令牌 2、卸载# 停止服务gitlab-runner stop# 取消开机启动chkconfig gitlab-runner off# 卸载服务gitlab-runner uninstall# 清理文件rm -rf /etc/gitlab-runnerrm -rf /usr/local/bin/gitlab-runnerrm -rf /usr/bin/gitlab-runnerrm -rf /etc/sudoers.d/gitlab-runner