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 天前
CMake赋能持续集成|自动化测试落地的进阶指南 ✨
c++·ci/cd·软件工程·软件构建
AI成长日志2 天前
【GitHub开源项目】Harness CI/CD平台深度解析:架构设计、核心功能与实战指南
ci/cd·开源·github
清水白石0082 天前
Python 项目 CI/CD 信心模型:证据驱动部署,从“勇敢上线”到“零风险发版”实战指南
驱动开发·python·ci/cd
alan07212 天前
【持续集成、持续交付】jenkins实现CI/CD
运维·ci/cd·jenkins
龙智DevSecOps解决方案2 天前
TESSY v5.1 新功能详解 :引入 Hyper Coverage 与基于变更的测试,大幅缩短 CI 测试时间
自动化测试·软件测试·ci/cd·单元测试·嵌入式开发·tessy
Rabbit_QL2 天前
【CI/CD】01_为什么手动部署是个危险游戏
游戏·ci/cd
亚马逊云开发者3 天前
告别手动部署:在 Amazon EKS 上用 CodePipeline + Argo CD 搭建 GitOps CI/CD
elasticsearch·ci/cd·kubernetes
清水白石0083 天前
《Python 静态检查链:格式化、Lint、类型检查、安全扫描全攻略——CI 阻断策略与团队平衡实践》
python·安全·ci/cd
Rabbit_QL3 天前
【CI/CD】02_一次 git push 后发生了什么?CI 是怎么工作的
git·ci/cd
tianyuanwo3 天前
服务器OS多架构CI流水线架构设计:单架构隔离与多架构融合的权衡之道
服务器·ci/cd·架构