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

相关推荐
信创天地1 小时前
信创环境下CI/CD与灾备体系构建:从异构挑战到自主可控的运维革命
运维·ci/cd
熊猫钓鱼>_>1 小时前
对话式部署实践:从零开始使用TRAE SOLO构建自动化CI/CD Pipeline
运维·ci/cd·自动化·devops·trae·solo·trae solo
tzhou6445220 小时前
Docker的CICD持续集成
ci/cd·docker·容器
叫致寒吧21 小时前
CICD持续集成Ruo-Yi项目
ci/cd
少云清1 天前
【接口测试】2_持续集成 _Git与Gitee
git·ci/cd·gitee
开开心心就好1 天前
右键菜单管理工具,添加程序自定义名称位置
linux·运维·服务器·ci/cd·docker·pdf·1024程序员节
应用市场1 天前
电脑通过HDMI反向控制外接显示器亮度和声音——DDC/CI与CEC协议全解析
ci/cd·电脑
少云清1 天前
【接口测试】3_持续集成 _Jenkins
运维·ci/cd·jenkins
菩提祖师_1 天前
基于增量微调的大语言模型领域更新方法
c++·深度学习·ci/cd·云原生
菩提祖师_2 天前
云原生应用的持续集成与持续部署优化
ci/cd·云原生