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

相关推荐
tnan25228 小时前
基于阿里云效实现cicd记录
阿里云·ci/cd·docker·容器·自动化
fruge14 小时前
GitHub Actions CI/CD 自动化部署完全指南
ci/cd·自动化·github
FJW0208141 天前
DevOps——CI/CD持续集成与持续交付/部署的理解与部署
运维·ci/cd·devops
我就是全世界2 天前
告别手动部署!GitHub Workflow与Action完全指南:从零构建自动化CI_CD流水线
ci/cd·自动化·github
创实信息2 天前
创实信息正式成为极狐GitLab中国授权代理
ci/cd·gitlab·devops·代码管理·极狐
路由侠内网穿透.2 天前
本地部署轻量级持续集成工具 Drone CI 并实现外部访问
运维·服务器·ci/cd·远程工作
安冬的码畜日常2 天前
【JUnit实战3_22】 第十三章:用 JUnit 5 做持续集成(下):Jenkins + JUnit 5 + Git 持续集成本地实战演练完整复盘
git·测试工具·ci/cd·jenkins·集成测试·持续集成·junit5
一念一花一世界2 天前
Jenkins vs GitLab CI/CD vs Arbess,CI/CD工具一文纵评
ci/cd·gitlab·jenkins·arbess
猫林老师3 天前
HarmonyOS自动化测试与持续集成实战指南
ci/cd·华为·harmonyos
荣光波比4 天前
CI/CD(三)—— 【保姆级实操】Jenkins+Docker GitLab+Tomcat 实现微服务CI/CD全流程部署
ci/cd·docker·jenkins