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

相关推荐
Sopaco1 天前
告别项目文档滞后:Litho(deepwiki-rs)在CI/CD中的自动化文档生成实践
运维·ci/cd·自动化
rocksun5 天前
基于GitOps的平台工程:Crossplane与ArgoCD实战
ci/cd·devops
Lin_Aries_04216 天前
基于 CI/CD 平台将应用程序自动部署到 Kubernetes 集群
运维·ci/cd·docker·云原生·容器·kubernetes·jenkins
Elastic 中国社区官方博客8 天前
CI/CD 流水线与 agentic AI:如何创建自我纠正的 monorepos
大数据·运维·数据库·人工智能·搜索引擎·ci/cd·全文检索
Lin_Aries_04218 天前
基于 CI/CD(Jenkins)将 Spring Boot 应用自动部署到 Kubernetes 集群
spring boot·ci/cd·docker·容器·自动化·jenkins
Vahala0623-孔勇8 天前
CI/CD流水线优化:GitLab CI镜像构建加速实战
ci/cd·gitlab
幼稚园的山代王8 天前
utf8mb4_bin、 utf8mb3_general_ci 、utf8mb4_0900_ai_ci 这几个有什么区别
ci/cd
C-20029 天前
初探 ansible 部署 devops 持续集成持续交付
ci/cd·ansible·devops
Grassto9 天前
免费的 CI/CD 服务,了解一下 GitHub Actions ?
ci/cd·github·github actions
卓码软件测评9 天前
K6的CI/CD集成在云原生应用的性能测试应用
前端·功能测试·测试工具·ci/cd·云原生