CI 与 Jenkins:如何强制在从机而不是主机上进行构建? [英] CI with Jenkins: how to force building happen on slaves instead of master?

查看:10
本文介绍了CI 与 Jenkins:如何强制在从机而不是主机上进行构建?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Jenkins 进行 CI,我有一个 master 和两个 slave,master 正在运行 Jenkins,我只希望 slave 执行实际的构建任务,有什么地方可以配置它吗?我知道有一个执行者",如果我在 master 上将其更改为 0,则 master 可能不会构建任何东西,但是有什么合适的方法可以做到这一点吗?

I am using Jenkins for CI, I have a master and two slaves, master is running Jenkins and I want only slaves doing the actual building task, is there anywhere I can configure this? I know there is an 'executor', if I change it to 0 on master, probably master won't build anything, but is there any proper way to do this?

推荐答案

您可以使用作业中的限制此项目的运行位置"选项来设置作业的运行位置.此设置可以与您添加到从站的标签一起使用.

You can set where a job will be run using the "Restrict where this project can be run" option in your job. This setting can be used together with tags you have added to your slaves.

例如,两个具有标签Linux-buildserver"并使用该标签的从属服务器会将作业拆分到这两个从属服务器上.将 IP 地址设置为作业中的标记将确保仅使用 buildserver/slave.

For example two slaves having the tag "Linux-buildserver" and using that tag will split the job up on those two slaves. Setting the IP-address as a tag in the job will make sure only that buildserver / slave is used.

这篇关于CI 与 Jenkins:如何强制在从机而不是主机上进行构建?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆