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

相关推荐
keson要进步1 天前
CICD实战(一) -----Jenkins的下载与安装
运维·ci/cd·centos·自动化·jenkins
爱宇阳1 天前
使用 Docker Compose 部署 Jenkins(LTS 版)持续集成环境
ci/cd·docker·jenkins
头疼的程序员3 天前
Jenkins的学习与使用(CI/CD)
ci/cd·jenkins
试剂界的爱马仕3 天前
软珊瑚成分 CI-A:靶向口腔癌细胞的 “氧化利剑” 与 ERK 密码
网络·人工智能·科技·机器学习·ci/cd·ai写作
用户26834842239593 天前
前端搭建 CI/CD 工作流指南
前端·ci/cd
星释3 天前
如何编写GitLab-CI配置文件
ci/cd·gitlab
It's Q4 天前
从测试角度看待CI/CD,敏捷开发
ci/cd·自动化·敏捷流程
t198751284 天前
jenkins结合gitlab实现CI
ci/cd·gitlab·jenkins
星释5 天前
Golang持续集成与自动化测试和部署
开发语言·ci/cd·golang
qk_antares5 天前
Jenkins实战——以Spring Boot和Vue的Hello World应用为例
ci/cd·jenkins