今天来讲一下如何使用gitlab-runner

下载runner,根据自己对应服务器的型号自行选择下载:

 # Linux x86-
sudo wget -O /usr/local/bin/gitlab-runner https://gitlab-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-runner-linux-amd64 # Linux x86
sudo wget -O /usr/local/bin/gitlab-runner https://gitlab-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-runner-linux-386 # Linux arm
sudo wget -O /usr/local/bin/gitlab-runner https://gitlab-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-runner-linux-arm

耐心等待下载完毕

下载完之后,需要给gitlab-runner执行权限,

sudo chmod +x /usr/local/bin/gitlab-runner

之后创建一个gitlab-runner用户,之后使用CI/CD时,都是在这个用户下进行的。

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

创建好了用户之后,接下来安装gitlab-runner

sudo gitlab-runner install --user=gitlab-runner --working-directory=/home/gitlab-runner

安装好以后,如上图所示

安装成功以后,启动gitlab-runner

sudo gitlab-runner start

如何注册使用gitlab-runner:

首先找到自己的gitlab项目下设置,CI/CD,Runner

可以看到如下:

URL,和注册令牌一会在注册runner的时候需要用到,

在自己的runner服务器上,输入如下命令,开始注册runner:

gitlab-runner register

上面这里,红框,填写刚刚上面看到的URL

回车后,输入URL下面的gitlab-ci token

输入完token后,回车

填写runner描述,这里自己填写

之后填写runner的tags,用于在之后CI/CD操作时标识使用哪个runner来进行流水线

,之后选择需要以哪种方式运行runner,这里我选择用shell方式运行runner,大家可以自行根据自己需要选择

到此,runner就注册完毕了。可以到gitlab上看下,刚刚注册的runner是否存在

可以看到,这里就是我们刚刚注册的runner。

gitlab runner安装与使用的更多相关文章

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

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

  2. docker-Gitlab、GitLab Runner安装

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

  3. [转] 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 ...

  4. Ubuntu安装Gitlab Runner

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

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

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

  6. gitlab一键安装 (转)

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

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

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

  8. 基础架构之Gitlab Runner

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

  9. gitlab一键安装 笔记

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

随机推荐

  1. Mac idea激活

    感谢https://blog.csdn.net/HALEN001/article/details/81137092 1.下载IntelliJ IDEA 2018.2.2版本和破解补丁Jetbrains ...

  2. 项目总结三:目标检测项目(Car detection with YOLOv2)

    1. the YOLO model (YOLO ,you only look once) (1)We will use 5 anchor boxes. So you can think of the ...

  3. 【翻译】JavaScript中5个值得被广泛使用的数组方法

    原文地址:http://colintoh.com/blog/5-array-methods-that-you-should-use-today?utm_source=javascriptweekly& ...

  4. JavaScript中的原型链原理

    工作中经常解除到prototype的概念,一开始错误的认为prototype是对象的原型链,其实prototype只能算是JavaScript开放出来的原型链接口,真正的原型链概念应该是__proto ...

  5. 微信小程序内嵌业务域名内的网页

    微信小程序在2017年11月左右开放了内嵌网页的功能,即新组件<web-view>.官方文档链接:https://mp.weixin.qq.com/debug/wxadoc/dev/com ...

  6. MySQL 分支的选择:Percona 还是 MariaDB

    原文:https://www.biaodianfu.com/mysql-percona-or-mariadb.html 在MySQL被Oracle收购以后,越来越多的人对于MySQL的前景表示了担忧, ...

  7. HP-JavaUtil: xls 操作类

    Written In The Font 谢谢,陈明.哈哈!共勉,努力搞定它. 路漫漫其修远兮,吾将上下而求索 Content ExportExcelAndSave( String[] header, ...

  8. 基于Github&Hexo的个人博客搭建过程

    大家好,这里是「 从零开始学 Web 系列教程 」,并在下列地址同步更新...... github:https://github.com/Daotin/Web 微信公众号:Web前端之巅 博客园:ht ...

  9. java web路径和spring读取配置文件

    此篇博客缘起:部署java web系统到阿里云服务器(ubuntu14.04)的时候,有以下两个问题 找不到自定义的property配置文件 上传图片的时候找不到路径 开发的时候是在windows上的 ...

  10. MongoDB副本集(一主两从)读写分离、故障转移功能环境部署记录

    Mongodb是一种非关系数据库(NoSQL),非关系型数据库的产生就是为了解决大数据量.高扩展性.高性能.灵活数据模型.高可用性.MongoDB官方已经不建议使用主从模式了,替代方案是采用副本集的模 ...