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 天前
自动化发布工具CI/CD实践Jenkins常用工具和插件的使用
运维·ci/cd·自动化·jenkins·自动化发布
Apifox1 天前
如何在 Apifox 中通过 Runner 运行包含云端数据库连接配置的测试场景
前端·后端·ci/cd
不能只会打代码2 天前
六十天前端强化训练之第三十四天之CI/CD 大师级深度解析
ci/cd
小小寂寞的城2 天前
Ubuntu里安装Jenkins
ubuntu·ci/cd·docker·jenkins
程序员三藏2 天前
Python+Jenkins+Allure Report接口自动化测试持续集成
自动化测试·软件测试·python·测试工具·ci/cd·jenkins·测试用例
qq_413691353 天前
CI/CD(九) Jenkins共享库与多分支流水线准备
运维·ci/cd·jenkins
字节程序员5 天前
Jenkins 持续集成:Linux 系统 两台机器互相免密登录
linux·软件测试·ci/cd·jenkins
全栈开发七分钟5 天前
vercel开源平替,dokploy七分钟国内安装指南
前端·后端·ci/cd
whiteBrocade5 天前
CI/CD-Jenkins安装与应用
运维·ci/cd·jenkins
遇见火星5 天前
自动化发布工具CI/CD实践Jenkins介绍!
运维·ci/cd·自动化·jenkins·自动化发布