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 天前
828华为云征文|Flexus X实例Docker+Jenkins+gitee实现CI/CD自动化部署-解放你的双手~
ci/cd·docker·gitee·华为云·jenkins
俗庸2033 天前
带你如何使用CICD持续集成与持续交付
运维·ci/cd
laufing3 天前
基于 jenkins 的持续集成、持续部署方案
运维·ci/cd·jenkins·开发
demon75520034 天前
GitLab CI_CD 从入门到实战笔记
笔记·ci/cd·gitlab
m0_629776925 天前
CI/CD中gitlab和jenkins讲解
git·ci/cd·gitlab·jenkins
Flying_Fish_roe5 天前
JUnit 5 详解
ci/cd·自动化·devops
风吟Pro6 天前
GitLab CI Runner安装
ci/cd·gitlab
[禾火]6 天前
CICD 持续集成与持续交付
ci/cd
dark_rabbit6 天前
CI/CD持续集成和持续部署以及相关软件的使用
ci/cd
Flying_Fish_roe7 天前
DevOps -CI/CD 与自动化部署
ci/cd·自动化·devops