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

相关推荐
天天进步201515 小时前
现代前端开发流程:CI/CD与自动化部署实战
运维·ci/cd·自动化
慧都小项1 天前
降本增效!自动化UI测试平台TestComplete并行测试亮点
自动化测试·ci/cd·跨平台·ui测试·回归测试·并行测试·环境兼容
故作春风2 天前
从零开始学 GitHub Actions:用自动化提升开发效率
ci/cd·自动化运维
seth2 天前
coding 要停服了, 把所有 CI 迁移到 Github 上 (服务器无需翻墙)
ci/cd·docker·github
mCell4 天前
Webhook:连接、自动化与系统集成的新范式
ci/cd·go·github
Gold Steps.4 天前
基于 Gitlab、Jenkins与Jenkins分布式、SonarQube 、Nexus 的 CiCd 全流程打造
运维·ci/cd·gitlab·jenkins
LCG元5 天前
基于MCP的CI/CD流水线:自动化部署到云平台的实践
运维·ci/cd·自动化
鼠鼠我捏,要死了捏5 天前
生产环境CI/CD流水线构建与优化实践指南
ci/cd·devops·流水线
mapengpeng1999@163.c5 天前
持续集成持续发布CICD
ci/cd
老马啸西风6 天前
maven 发布到中央仓库之 Ignore Licence-04
java·ci/cd·maven