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

相关推荐
霸道流氓气质1 天前
GitLab CI/CD 完全指南
linux·ci/cd·gitlab
sbjdhjd1 天前
从零搭建企业级 CI/CD(下):Jenkins+GitLab+Harbor 全链路实战指南
git·servlet·ci/cd·云原生·云计算·gitlab·jenkins
糖果店的幽灵2 天前
软件测试接口测试从入门到精通:接口测试CI_CD集成
软件测试·ci/cd·接口测试
平头老王3 天前
CI/CD流水线设计 — 第1章:常见误区
ci/cd·自动化·devops·持续部署·持续集成
星落zx3 天前
在CI/CD流水线里接入多模型自动Code Review,踩坑与方案分享
人工智能·ci/cd·代码复审
又是进步的一天3 天前
一台虚拟机学习CI流程
学习·ci/cd·云原生·容器·kubernetes·devops
w3296362714 天前
八、OpenCode 高阶玩法:CLI 自动化、CI/CD 集成与远程协作
运维·ci/cd·自动化·ai编程·开发工具·opencode
brycegao4 天前
如何搭建标准化 Git 工具流,保障 Android 团队代码质量
android·ci/cd
Dontla4 天前
CI/CD前世今生(持续集成、持续交付、持续部署、Jenkins、Github Actions)
ci/cd·github·jenkins
小雨青年5 天前
GitHub Actions 可复用工作流设计模式:把 CI/CD 重复逻辑收起来
ci/cd·设计模式·github