将Jenkins作业限制为Linux从站 [英] Restrict Jenkins Job To Linux Slaves

查看:92
本文介绍了将Jenkins作业限制为Linux从站的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何限制我的Jenkins作业只能在Linux奴隶上运行?

How do I restrict my Jenkins job to just run on Linux slaves?

我在限制了该项目的运行位置框中打了勾,但是看来我只能在其中输入从属名称.

I have ticked the Restrict where this project can be run box but it seems I can only put the slave names in there.

我想说的是使用在Linux平台上运行的任何从设备

类似于teamcity.agent.jvm.os.name等于TeamCity中的Linux选项.

Similar to the teamcity.agent.jvm.os.name equals Linux option in TeamCity.

到目前为止,您似乎必须手动编辑每个从站的标签(或编写脚本).不幸的是,我无权更改这些内容,因此,如果有人提出其他选择,插件或其他东西,我将保留此问题.

So far it looks like you have to manually edit each slave's label (or script it). Unfortunately, I don't have rights to change these, so I will keep this question open in case someone comes up with an alternative or a plugin or something.

推荐答案

您快到了.只需使用标签"linux"等标记您的linux从属设备,然后将该字符串输入限制该项目的运行位置字段.使用管理Jenkins">管理节点"将标签添加到适当的从站.

You are almost there. Simply label your linux slaves with the tag "linux" or the like and enter that string into the Restrict where this project can be run field. Use Manage Jenkins > Manage Nodes to add the label to the appropriate slaves.

这篇关于将Jenkins作业限制为Linux从站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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