如何防止某些 Jenkins 作业同时运行? [英] How to prevent certain Jenkins jobs from running simultaneously?

查看:27
本文介绍了如何防止某些 Jenkins 作业同时运行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有几个使用共享资源(数据库)的作业,这有时会导致构建在作业碰巧同时触发的(罕见)事件中失败.

I have a couple of jobs that use a shared resource (database), which sometimes can cause builds to fail in the (rare) event that the jobs happen to get triggered simultaneously.

例如,给定作业 A 到 E,有没有办法指定 A 和 C 不应同时运行?

Given jobs A through E, for example, is there any way to specify that A and C should never be run concurrently?

除了上述资源,构建是相互独立的(不是例如上游/下游关系).

Other than the aforementioned resource, the builds are independent of each other (not e.g. in a upstream/downstream relation).

蛮力"方式将执行器的数量限制为一个,但如果大多数作业可以很好地并发执行并且构建服务器上不缺乏计算资源,这显然不太理想.

A "brute-force" way would be limiting number of executors to one, but that obviously is less than ideal if most jobs could well be executed concurrently and there's no lack of computing resources on the build server.

推荐答案

目前有两种方法:

这篇关于如何防止某些 Jenkins 作业同时运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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