安装Install a runner

安装Install a runner

Download and install binary
Download latest binary
# Download the binary for your system
sudo curl -L --output /usr/local/bin/gitlab-runner https://gitlab-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-runner-linux-amd64

# Give it permissions to execute
sudo chmod +x /usr/local/bin/gitlab-runner

# Create a GitLab CI user
sudo useradd --comment 'GitLab Runner' --create-home gitlab-runner --shell /bin/bash

# Install and run as service
sudo gitlab-runner install --user=gitlab-runner --working-directory=/home/gitlab-runner
sudo gitlab-runner start

Command to register runner
sudo gitlab-runner register --url http://192.168.10.12:5678/ --registration-token $REGISTRATION_TOKEN

注册 Runner
首先需要准备URL和Token,可以在 GitLab 项目的 settings->CI/CD->Runners settings 中找到
# 注册
sudo gitlab-runner register

# 输入本地的 gitlab URL
Please enter the gitlab-ci coordinator URL (e.g. https://gitlab.com )
https://gitlab.com

# 输入 Token
Please enter the gitlab-ci token for this runner
xxx

# 输入 tag, 注意要跟 job 的 tag 一致,后续详细说明
Please enter the gitlab-ci tags for this runner (comma separated):
my-tag,another-tag

# 选择 executor, 
Please enter the executor: ssh, docker+machine, docker-ssh+machine, kubernetes, docker, parallels, virtualbox, docker-ssh, shell:
docker

使用 tags

Runner 默认只会在配置了和自身 tags 一致的项目上运行,是为了防止 Runner 运行在大量项目上出现问题。

同时可以在 Runner 中取消该设置,允许 Runner 运行在无 tags 的项目上,配置如下

  1. Visit your project’s Settings ➔ CI/CD
  2. Find the Runner you wish and make sure it’s enabled
  3. Click the pencil button
  4. Check the Run untagged jobs option
  5. Click Save changes for the changes to take effect

executor

Executors | GitLab

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

lisanmengmeng

蚊子腿也是肉

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值