gitlab-runner安装部署CI/CD

手动安装

卸载旧版:

gitlab-runner --version
gitlab-runner stop
yum remove gitlab-runner

下载gitlab对应版本的runner

# 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

添加用户:

sudo useradd --comment 'GitLab Runner' --create-home gitlab-runner --shell /bin/bash

增加权限:

vi /etc/sudoers

## 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, 

启动服务:

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)

gitlab-runner register --url https://ywzcgit.kaixinxiyou.com/ --registration-token oLJywozixrWb721WLx1R

在这里插入图片描述
在这里插入图片描述

runner配置

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. docker安装gitlab-runner

    2024-07-10 04:08:03       50 阅读
  2. CICD注册和使用gitlab-runner常见问题

    2024-07-10 04:08:03       53 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-07-10 04:08:03       99 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-07-10 04:08:03       107 阅读
  3. 在Django里面运行非项目文件

    2024-07-10 04:08:03       90 阅读
  4. Python语言-面向对象

    2024-07-10 04:08:03       98 阅读

热门阅读

  1. 导师好奇我为什么开发后端模版只花了一小时!

    2024-07-10 04:08:03       27 阅读
  2. android 7.0 tts文字转语音

    2024-07-10 04:08:03       24 阅读
  3. 离线升级docker中的某个镜像——以etcd为例

    2024-07-10 04:08:03       52 阅读
  4. 将pytorch 模型封装为c++ api 例子

    2024-07-10 04:08:03       34 阅读
  5. Rust: 关于Pin以及move前后分析

    2024-07-10 04:08:03       32 阅读
  6. LVS实验

    LVS实验

    2024-07-10 04:08:03      28 阅读
  7. 【Git】取消追踪多个文件或目录

    2024-07-10 04:08:03       24 阅读
  8. 环境变量Path

    2024-07-10 04:08:03       27 阅读