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. Unity3D——鼠标双击

    Unity之鼠标双击 小黑终于又回到公司了! 能在公司安生的待段时间了,今天更新一篇吧! 懒惰的小黑给大家分享个好东西吧,解决双击之痛! 前言 小黑相信有许多人和我一样.万年不会碰到一个需求:双击!可 ...

  2. 【随笔记】Littlevgl 8.x 踩过的坑

    在多线程并发使用的时候,总是在运行过程中莫名其妙的 crash,后面才意识到 LVGL 本身不支持并发,加了互斥锁解决了. 在引入矢量字库时(freetype),又有启动时会概率性 crash 的问题 ...

  3. Linux06-常用命令 日期 日历 查找 过滤

    1.date  日期 2.cal 日历 3.find 查找 4.locate 查找 5.grep  过滤 1.时间日期类 date指令-显示当前日期 1)指令: date (功能描述:显示当前时间) ...

  4. VS 撰写生成了多个撰写错误,其根本原因有X点,如下所列。有关详细信息,请查看CompositionException.Error属性

    打开VS开发程序,莫名其妙的出现如下图错误: 网上找了很多资料,有前辈说以下方法: 解决方案如下 打开文件夹 Users\<CurrentUser>\AppData\Local\Micro ...

  5. ROS入门:话题

    1.listener.cpp #include "ros/ros.h" #include "std_msgs/String.h" //回调函数,接收到话题后进入 ...

  6. CSS常用属性(3)

    (9) list-style(列表样式) 类型 list-style-type: disc | circle | square | decimal | lower-roman | upper-roma ...

  7. CSS_语法格式

    * 格式: 选择器{ 属性名1:属性值1: 属性名2:属性值2: ... } *选择器:筛选具有相似特征的元素 *注意: *没一对属性需要使用":"隔开,对最后一对属性可以不加&q ...

  8. VScode本地搭建服务代码如何让其他人访问?

    如本地开发域名访问: http://127.0.0.1:5500/pages/information/information.html?id=2259 想让别人访问: win+R -------> ...

  9. 将python2.7项目转为Python3问题记录

    将一个Python2.7开发的测试工具项目转化为Python3. 工具:Python自带的2to3.py 将所有.py文件进行转化,生成的python3文件为原文件名,python2文件在后面加.ba ...

  10. Laravel 框架根据经纬度计算在一定距离内的数据

    $model = DB::table('table_name'); public static function scope_distance($model, $from_latitude, $fro ...