当前位置: 首页> 文旅> 旅游 > gitlab-runner安装部署CI/CD

gitlab-runner安装部署CI/CD

时间:2025/8/25 21:34:37来源:https://blog.csdn.net/uisoul/article/details/140303455 浏览次数:0次

手动安装

卸载旧版:

gitlab-runner --version
gitlab-runner stop
yum remove gitlab-runner

下载gitlab对应版本的runner

# https://docs.gitlab.com/runner/install/bleeding-edge.html#download-any-other-tagged-releasecurl -L --output /usr/bin/gitlab-runner "https://s3.dualstack.us-east-1.amazonaws.com/gitlab-runner-downloads/latest/binaries/gitlab-runner-linux-amd64"
chmod +x /usr/local/bin/gitlab-runner

添加用户:

sudo useradd --comment 'GitLab Runner' --create-home gitlab-runner --shell /bin/bash

增加权限:

vi /etc/sudoers

## Allow root to run any commands anywhere 
root    ALL=(ALL)       ALL
gitlab-runner  ALL=(ALL)  NOPASSWD:ALL
## Allows members of the 'sys' group to run networking, software, 

启动服务:

sudo gitlab-runner install --user=gitlab-runner --working-directory=/home/gitlab-runner
sudo gitlab-runner start

注册Runner

GitLab CI/CD +Shell脚本实现简单的自动代码部署+重新启动dotnet 服务 - srsly - 博客园 (cnblogs.com)

gitlab-runner register --url https://ywzcgit.kaixinxiyou.com/ --registration-token oLJywozixrWb721WLx1R

在这里插入图片描述
在这里插入图片描述

runner配置

concurrent = 5 # 同时运行
check_interval = 0[session_server]session_timeout = 1800[[runners]]name = "authAdminRunner"url = "https://ywzcgit.kaixinxiyou.com/"token = "yCPnSz6f9hxk1h5Dg2zE"executor = "shell"[runners.cache][[runners]]name = "AuthCenter"url = "https://ywzcgit.kaixinxiyou.com/"token = "f-1z2sShzjyZsfYMsoaa"executor = "shell"[runners.custom_build_dir][runners.cache][runners.cache.s3][runners.cache.gcs][runners.cache.azure]

参考文档:
Install GitLab Runner using the official GitLab repositories | GitLab

关键字:gitlab-runner安装部署CI/CD

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: