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

相关推荐
青靴2 天前
轻量级日志监控与告警系统(二,下):CI/CD 具体部署实战,一行推送实现秒级更新
ci/cd
要站在顶端2 天前
基于 curl 实现 Jenkins 上传制品到 JFrog Artifactory
运维·ci/cd·jenkins
4***99743 天前
DevOps在云原生中的CI/CD流水线
ci/cd·云原生·devops
西部森林牧歌3 天前
Arbess从基础到高阶(14) - 使用Arbess+GitLab+SonarQube实现代码扫描完成后自动化部署
ci/cd·gitlab·sonarqube·arbess·tiklab devops
青靴3 天前
虚拟机上实现最简 CI/CD
ci/cd·devops
青靴4 天前
轻量级 CI/CD:Git Hooks 自动部署 Node.js 应用(CICD-demo)
git·ci/cd·node.js
青靴4 天前
轻量级 CI/CD 实战(四):本地开发钉钉告警 → 自动部署云服务器 Kafka 消费者容器
ci/cd·docker·钉钉
奔跑吧邓邓子5 天前
Jenkins自动化持续集成:从入门到实战
ci/cd·自动化·实战·jenkins·自动化持续集成
青靴5 天前
Git Hooks 实现 CI/CD 进阶实践 -- 根据实际需求添加功能
git·elasticsearch·ci/cd
DreamLife☼5 天前
Docker-CI/CD:集成 GitHub Actions 实现自动化构建与部署
ci/cd·docker·自动化部署·github actions·镜像构建·trivy 扫描·compose 部署