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. 命令行部署repmgr管理集群+switchover+切换测试

    本次部署未使用securecmd/kbha工具.无需普通用户到root用户的互信. 建立系统数据库安装用户组及用户,在所有的节点执行 root用户登陆服务器,创建用户组及用户并且设置密码 [root@ ...

  2. 虚拟DOM中给同一层级的元素设置固定且唯一的key为什么能提高性能

    一.文字 key让React知道,当前新生成的React元素中的元素,是否能在之前生成的React元素中找到对应的.如果有,那么直接拿过来用就行了.假设列表头部插入一项,通过比对,React知道除了头 ...

  3. Markdown箭头总汇

    Markdown箭头的汇总 普通箭头 \[\uparrow \] $$\uparrow$$ \[\Uparrow \] $$\Uparrow$$ \[\downarrow \] $$\downarro ...

  4. Vue 03 VisualStudioCode 搭建一个Vue 框架 的详细流程

    转:https://blog.csdn.net/A_awen/article/details/122345082 1 下载VisualStudioCode 1.1 官网下载地址 https://cod ...

  5. Redis避坑指南:为什么要有分布式锁?

    作者:京东保险 张江涛 1.为什么要有分布式锁? JUC提供的锁机制,可以保证在同一个JVM进程中同一时刻只有一个线程执行操作逻辑: 多服务多节点的情况下,就意味着有多个JVM进程,要做到这样,就需要 ...

  6. TEB学习

    官方资料:http://wiki.ros.org/teb_local_planner/Tutorials set up and test Optimization(重要) Inspect optimi ...

  7. rt-thread模糊到清晰系列: ipc.c

    #include <rtthread.h> #include <rthw.h> #ifdef RT_USING_HOOK extern void (*rt_object_try ...

  8. P4238 【模板】多项式乘法逆

    #include <cstdio> #include <iostream> #define re register using namespace std; typedef l ...

  9. Destroying Roads

    题目链接 \(Destroying\) 分析 又是变形了的最短路 我们可以考虑哪些道路必须被保留 然后枚举两个起点到终点重复的道路 考虑公合法用这些道路就可以了 \(Code\) #include&l ...

  10. C语言数据结构串的表示与操作的实现

    串的堆分配储存表示 typedef struct { char* ch;//若是非空字符串,则按串长分配存储区,否则ch为NULL int length;//串长度 } HString; 生成一个其值 ...