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. 关于VBA中,activesheet用法的一些思考

    前二天,给财务部做了个数据采集的工具,因为财务现在用的是excel2013 和2017的版本,所以我决定不用python,改用VBA来处理这个工具. 在 写过程的时候,我用了sheets(i)来定位表 ...

  2. golang 切片的长度和容量

    开始接触golang的时候,对切片的长度和容量变化不是很了解,所以打印出来探索了下. 代码如下: 打印结果如下:

  3. sync.Once 使用及解析

    目录 前言 1. sync.Once 简介 2. sync.Once 源码解析 2.1 为什么 done 作为第一个字段 2.2 Do 方法的实现细节 2.3 其他重要细节 3. sync.Once ...

  4. 报错One record is expected, but the query result is multiple records

    总结:出现这种情况,显而易见,就是查询的数据在数据库中不止一条,而我调用的selectOne方法,返回值是一个User对象,导致报错 点击查看错误代码 LambdaQueryWrapper<Us ...

  5. C-08\变量类别和名称粉碎机制

    全局变量 定义:在所有函数外部定义的变量称为全局变量,一般以g_开头,如 char g_szBuf[100]; // 全局变量g_szBuf int main() { printf("%s\ ...

  6. 《关于我因为flink成为spark源码贡献者这件小事》

    各位读者老爷请放下手上的板砖,我可真没有标题党,且容老弟慢慢道来. spark和flink本身相信我不用做过多的介绍,后端同学不管搞没搞过大数据,应该都多多少少听过. 如果没听过,简单说,spark和 ...

  7. Node Sass could not find a binding for your current environment: Windows 64-bit with Node.js 1x.x

    出现问题原因: nodejs和node-sass版本不匹配 解决办法: 下载node-sass指定版本的nodejs 1)node-sass的节点版本支持政策 ① 支持的 Node.js版本因版本而异 ...

  8. SRS视频服务器CallBack的Demo

    1.安装环境(很麻烦,可以选择编译启动) 官方文档快速开始docker配置: docker run --rm -it -p 1935:1935 -p 1985:1985 -p 8080:8080 -d ...

  9. app实现外部浏览器打开链接

    需求:安卓和IOS开发的混合app.前端使用vue,vant2,安卓使用java,ios使用的object-c.实现效果:点击按钮,下载PDF附件,app跳转到手机外部浏览器,下载附件...... 1 ...

  10. LeetCode-357 统计各位数字都不同的数字个数

    来源:力扣(LeetCode)链接:https://leetcode-cn.com/problems/count-numbers-with-unique-digits 题目描述 给你一个整数 n ,统 ...