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

相关推荐
维尔切4 小时前
Jenkins 持续集成与部署
运维·ci/cd·jenkins
matlab_xiaowang18 小时前
Woodpecker CI 轻量级持续集成系统深度解析
其他·ci/cd
谢尔登1 天前
【GitLab/CI】前端 CI
前端·ci/cd·gitlab
脆皮猪3 天前
Gitlab结合阿里云ECS进行弹性伸缩构建
ci/cd
hweiyu003 天前
Gradle 与 CI/CD 集成:Jenkins/GitHub Actions 自动化构建配置
ci/cd·github·jenkins·gradle
Bruce-li__4 天前
CI/CD流水线全解析:从概念到实践,结合Python项目实战
开发语言·python·ci/cd
一念一花一世界6 天前
Arbess从入门到实战(17) - 使用Arbess+GitPuk+SonarQube实现Java项目代码扫描及自动化部署
ci/cd·1024程序员节·tiklab·arbess
三坛海会大神5556 天前
CICD(一)CI/CD概述及GitLab部署和一些Git命令
git·ci/cd·1024程序员节
荣光波比6 天前
CICD(一)—— 从零搭建 GitLab 全流程(Docker 部署 + 实战指南)
git·ci/cd
鼓掌MVP6 天前
CI/CD:现代软件开发的持续交付之道
ci/cd