gitlab-runner安装部署CI/CD

手动安装

卸载旧版:

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

下载gitlab对应版本的runner

shell 复制代码
# https://docs.gitlab.com/runner/install/bleeding-edge.html#download-any-other-tagged-release

curl -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

添加用户:

shell 复制代码
sudo useradd --comment 'GitLab Runner' --create-home gitlab-runner --shell /bin/bash

增加权限:

vi /etc/sudoers

shell 复制代码
## 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, 

启动服务:

shell 复制代码
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)

shell 复制代码
gitlab-runner register --url https://ywzcgit.kaixinxiyou.com/ --registration-token oLJywozixrWb721WLx1R


runner配置

toml 复制代码
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

相关推荐
小张认为的测试9 分钟前
Liunx上Jenkins 持续集成 Java + Maven + TestNG + Allure + Rest-Assured 接口自动化项目
java·ci/cd·jenkins·maven·接口·testng
周杰伦_Jay20 小时前
详细介绍:Kubernetes(K8s)的技术架构(核心概念、调度和资源管理、安全性、持续集成与持续部署、网络和服务发现)
网络·ci/cd·架构·kubernetes·服务发现·ai编程
JZC_xiaozhong1 天前
低空经济中的数据孤岛难题,KPaaS如何破局?
大数据·运维·数据仓库·安全·ci/cd·数据分析·数据库管理员
JZC_xiaozhong6 天前
支付宝“政府补贴”bug事件背后的权限管理启示
大数据·数据库·安全·ci/cd·金融·云计算·bug
_.Switch7 天前
高效构建与部署Python Web应用:FastAPI的测试与持续集成
前端·网络·数据库·python·ci/cd·fastapi
ihengshuai7 天前
手摸手实战前端项目CI CD
前端·ci/cd·云原生·kubernetes·devops
阳光阿盖尔8 天前
【CI/CD构建】关于不小心将springMVC注解写在service层
ci/cd·持续集成·构建·持续交付·火麒麟
测试者家园9 天前
如何提高自动化测试覆盖率和效率
自动化测试·软件测试·人工智能·ci/cd·测试覆盖率·it行业·质量效能
cmgdxrz10 天前
持续集成 02|Jenkins介绍与安装、Postman集成Jenkins、代码集成Jenkins
运维·ci/cd·jenkins