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

相关推荐
Bruk.Liu6 小时前
Gitea Actions 的概念及基础使用
运维·ci/cd·持续集成
学嵌入式的小杨同学8 小时前
【Linux 实战】手写 ls 命令核心功能:C 语言实现文件属性与目录遍历(附完整可运行代码)
linux·运维·服务器·c语言·chrome·后端·ci/cd
叼奶嘴的超人9 小时前
手动创建Docker版Fastapi CI/CD镜像文件
ci/cd·docker·fastapi
_运维那些事儿10 小时前
GitLabCI/CD语法
linux·服务器·git·ci/cd·gitlab·运维开发·devops
_运维那些事儿10 小时前
GitLab&Jenkins
运维·ci/cd·gitlab·jenkins·devops
一念一花一世界10 小时前
Jenkins 太重?试试超轻量开源 CI/CD 工具 Arbess
运维·ci/cd·jenkins·arbess
卓码软件测评1 天前
第三方移动应用测试机构:【移动应用性能测试:使用LoadRunner的Mobile Application - HTTP/HTML协议】
测试工具·ci/cd·性能优化·单元测试·测试用例
卓码软件测评1 天前
【第三方双重资质软件测试机构:测试RESTful API和SOAP Web Services:LoadRunner协议选择和脚本编写】
测试工具·ci/cd·性能优化·单元测试·测试用例·restful
_运维那些事儿2 天前
GitLabCI-CD入门
运维·ci/cd·容器·云计算·k8s·运维开发
henujolly2 天前
How do you troubleshoot a CI failure?
java·开发语言·ci/cd