Git_Lab CI Setting

  1. 根据该教程本地下载并安装 gitlab-runner.exe

  2. 在GitLab远程仓库页面点击 setting-> CI/CD ->runner Expand ,然后拷贝 Runner setup URL , registration token到第三步输入

  3. install gitlab-runner.exe and register on local PC

    # at the git runner folder
    gitlab-runner.exe install
    gitlab-runner.exe register
    ...enter Runner setup URL
    ...enter registration token
    ...enter runner description
    ...enter runner tag (Unique Identification)
    ...enter script executor(depend on script language)
    ## automatically generate config.toml after success
  4. 修改runner中对应的config.toml

concurrent = 1
check_interval = 0

[session_server]
session_timeout = 1800

[[runners]]
name = " PC_1"
url = "https://gitlab.test.com/"
token = "test123456789"
executor = "shell"
builds_dir = "E:\\GitLab-Runner\\builds"
cache_dir = "E:\\GitLab-Runner\\cache"
environment = ["SCE_PHYRE=E:\\GitLab-Runner\\builds\\test"] #设置runner无法读取的环境变量
shell = "powershell" # 配置gitlab-ci.yml script会使用的语言 runner为win系统时建议使用powershell
[runners.custom_build_dir]
enabled = true # 自定义runner本地存储代码的位置
[runners.cache]
[runners.cache.s3]
[runners.cache.gcs]
  1. 在远程仓库根目录下创建t gitlab-ci.yml 文件

#ex:
compile:
script:
- cd /d "D:\test" # 执行runner命令,自定义
- echo test
tags:
- PC_1 # 选择“gitlab-runner.exe register”中设置的“runner tag”
variables:
GIT_CLEAN_FLAGS: -ffdx -e cache/ # 清空缓存
GIT_CLONE_PATH: $CI_BUILDS_DIR/$CI_PROJECT_NAME # 设置仓库下载地址
  1. 配置成功后在本地目录下启动runner

    gitlab-runner.exe run --syslog # 不可关闭当前terminal

注:

  • 修改config.toml、注册runner,需要关闭“gitlab-runner.exe run --syslog”(在当前终端Ctrl+C)

  • 一个gitlab-runner.exe可注册多个项目的runner,但不能过多, 同一台主机可以存在多个gitlab-runner.exe(不同目录,仓库地址也不能冲突)

  • config.toml中的“\”需要使用“\\”

CMD

gitlab-runner.exe install
gitlab-runner.exe register
gitlab-runner.exe start
gitlab-runner.exe restart
gitlab-runner.exe stop

gitlab-runner.exe run --syslog

ssh-keygen -t rsa -C xxx@xxx.com.cn #

.gitlab-ci.yml (Git_lab Code)

# 定义 stages
stages:
- test
- compile
test:
stage: test
script:
- echo test
tags:
- PC_1 deploy:
stage: compile
script:
- cd /d "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE"
- devenv.com "E:\GitLab-Runner\builds\test\test.sln" /rebuild "Release|x64"
tags:
- PC_1
variables:
GIT_CLEAN_FLAGS: -ffdx -e cache/ # clear git code
GIT_CLONE_PATH: $CI_BUILDS_DIR/$CI_PROJECT_NAME # code dir

QA:

删除register
  1. 在gitlab->setting->ci->runner->expand 删除对应runner

  2. 删除runner本地config.toml文件的对应runner配置

GitLab-Runner安装及使用的更多相关文章

  1. Gitlab CI持续集成 - GitLab Runner 安装与注册

    GitLab Runner安装 需要添加gitlab官方库: # For Debian/Ubuntu/Mint curl -L https://packages.gitlab.com/install/ ...

  2. gitlab runner安装与使用

    今天来讲一下如何使用gitlab-runner 下载runner,根据自己对应服务器的型号自行选择下载: # Linux x86- sudo wget -O /usr/local/bin/gitlab ...

  3. docker-Gitlab、GitLab Runner安装

    以下操作均在CentOs下操作 1.Gitlab install ① 启动gitlab docker run --detach \ --hostname 115.30.149.35 \ --publi ...

  4. [转] Gitlab 8.x runner安装与配置

    [From]http://muchstudy.com/2018/07/13/Gitlab-8-x-runner%E5%AE%89%E8%A3%85%E4%B8%8E%E9%85%8D%E7%BD%AE ...

  5. Ubuntu安装Gitlab Runner

    第一步: 添加GitLab的官方存储库:    curl -L https://packages.gitlab.com/install/repositories/runner/gitlab-runne ...

  6. 使用gitlab runner 进行CI(二):gitlab runner的安装与配置

    参考 https://docs.gitlab.com/runner/install/index.html,可以选择与gitlab相同的版本. gitlab runner可以通过安装binary包或do ...

  7. gitlab一键安装 (转)

    原文地址:http://www.2cto.com/os/201411/353292.html 0 简介bitnami和gitlab bitnami BitNami是一个开源项目,该项目产生的开源软件包 ...

  8. 超详细Gitlab Runner环境配置中文教程

    配置GitlabRunner环境 GitLab Runner 是一个开源项目, 它用来运行你定制的任务(jobs)并把结果返回给 GitLab. GitLab Runner 配合GitLab CI(G ...

  9. 基础架构之Gitlab Runner

    基础架构之Gitlab Runner也是常用的基础设施,我们接着GitLab操作,具体使用GitlabRunner,如果不熟悉可以见官方详细介绍https://docs.gitlab.com/runn ...

  10. gitlab一键安装 笔记

    0 简单介绍bitnami和gitlab bitnami BitNami是一个开源项目,该项目产生的开源软件包安装 Web应用程序和解决方式堆栈.以及虚拟设备. bitnami主办Bitrock公司成 ...

随机推荐

  1. Typora软件下载与markdown语法的使用

    Typora软件下载与markdown语法的使用 一.Typora下载 1.Typora的简介 Typora是一款轻量级文本编辑器,文本阅读器,是目前最火爆的文本编辑器. Typora中格式,字体,主 ...

  2. 编程哲学之 C# 篇:006——什么是 .NET

    本章将用本系列第二章中提到的 类比 思维来让读者快速了解什么是.NET. 当年在网上看到一个初学者问<Java编程思想>第一章看不懂怎么办.然后我发现在很多经典的技术书中,如<C#入 ...

  3. LeetCode_788. 旋转数字

    写在前面 难度:简单 原文:https://leetcode-cn.com/problems/rotated-digits/ 题目 我们称一个数 X 为好数, 如果它的每位数字逐个地被旋转 180 度 ...

  4. 强大的word插件,让工作更高效:不坑盒子 2023版

    不坑盒子简介 很多朋友在工作过程中需要对Word文档进行编辑处理,如果想让Word排版更有效率可以试试小编带来的这款不坑盒子软件,这是一个非常好用的插件工具,专门应用在Word文档中,支持Office ...

  5. STM32F0库函数初始化系列:PWM输出

    void TIM1_Configuration(void) { TIM_TimeBaseInitTypeDef TIM_Time1BaseStructure; TIM_OCInitTypeDef TI ...

  6. vue组件的对象式写法,vue中的h函数

    render:将虚拟dom转为真实dom h函数:创建的是vnode,也可以成为createVnode函数 语法:h(元素名称 ,这个元素的数据,子集) 第一个参数:可以为一个html标签,一个组件, ...

  7. 微信小程序分包

    当我们程序太大的时候,打开小程序就会比较慢,此处就需要用到分包加载,按照模块划分不同的包,让用户在需要的时候才加载对用的模块,也就是用户在进入某些页面的时候才下载该页面的资源,提高小程序的打开速度,以 ...

  8. 易语言 CS1.6单机开源

    一个绘制 一个修改器 垃圾玩意 https://kxd.lanzoul.com/iJiwf07ve61a https://kxd.lanzoul.com/iTT4n07w61tg

  9. kali挂代理之——proxychains4

    记一次打站需要用到kali,但是得挂代理,就从别人那里知道了一个kali挂代理的工具proxychains4. 首先是打开kali输入:root@Kali:~# vi /etc/proxychains ...

  10. 小程序动态class与动态style的写法:

    style = "opacity :{{num}}" class = "vp {{opacity == 0 ? 'opacity1':''}}"