如何在从属节点上交替运行jenkins build? [英] How to run jenkins build alternatively on slave nodes?

查看:149
本文介绍了如何在从属节点上交替运行jenkins build?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

比方说,我有一个工作A,还配置了一个从属.我想在主节点上运行作业A的版本1,在从属节点上运行作业A的版本2. 有实现这一目标的选择吗?

OR

有没有一种方法可以让我的工作集中在主服务器上,如果它已经找到了正在运行的构建,然后在从属服务器上开始下一个构建?

解决方案

您打算并行运行还是只是交替运行? (不是在主服务器上运行作业不是一个好主意; 可以将节点配置为与主机"在同一主机上运行.似乎是并行的,并且您在master和agent上每个只能有一个执行者(您可以有更多执行者,在这种情况下,任何建议都可能是没有意义的.)

然而,詹金斯将队列作业分配给执行者是粘性的";除非无法使用,否则它将尝试在上次运行的地方运行.这可能导致节点过载.因此,M,A,M,A模式是不自然的.

有些插件可能会有所帮助:最低负载 解决方案

Are you intending to run in parallel or just alternate? (Not a good idea to run jobs on master; could configure a node to run on same host as "master".). Seems to be parallel and you have restricted to one executor each on master and agent (you can have more, in which case any advice may be moot).

Nevertheless, Jenkins queue job allocation to executors is "sticky"; it tries to run where last run, unless unavailable. This can lead to overloading in nodes. So the M,A,M,A pattern is unnatural.

There are plugins that might help: Least Load, Scoring Load Balancer, but maybe not.

Perhaps an approach would be to restrict your job using a label and have a post-build groovy step that moves the label to the other upon success for the next run or two labels and the job self-modifies the label to match the other.

这篇关于如何在从属节点上交替运行jenkins build?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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