0%

GitLab Runner

安装GitLab Runner

下载最新的Runner

1
curl -L https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.rpm.sh | bash

安装Runner

1
2
3
yum -y install gitlab-ci-multi-runner #最新版
yum list gitlab-runner --showduplicates | sort -r #安装指定版本
yum install gitlab-runner-10.0.0-1

注册信息到gitlab

1
gitlab-runner register

部分信息如图

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
Please enter the gitlab-ci coordinator URL (e.g. https://gitlab.com/):
## 输入你的gitlab地址
http://192.168.1.83

Please enter the gitlab-ci token for this runner:
## gitlab的token(在gitlab的Admin Area中) 或者仓库的token(仓库->设置->Runner)
931qePwxjkeSX52Qhx3U

Please enter the gitlab-ci description for this runner:
## Runner描述信息
[gitlab-server]: my-runner

Please enter the gitlab-ci tags for this runner (comma separated):
## Runner的标签 可以指定仓库 只使用固定标签的Runner构建
my-tag

Please enter the executor: docker, docker-ssh, parallels, shell, kubernetes, custom, ssh, virtualbox, docker+machine, docker-ssh+machine:
## 输入runner运行的平台和方式
docker

Please enter the default Docker image (e.g. ruby:2.6):
your-image ## 运行的docker镜像
alpine:latest

Runner registered successfully. Feel free to start it, but if it's running already the config should be automatically reloaded!

Runner就安装完了

配置CI/CD

在项目中新增.gitlab-ci.yml文件

根据自己的需要进行修改或编写,具体使用方法不做介绍。

最终实现效果

-------------    本文结束  感谢您的阅读    -------------
请作者一杯咖啡。