运行前脚本以确定是否应运行 Jenkins 矩阵作业

发布于 2024-12-03 03:57:14 字数 552 浏览 1 评论 0原文

我有一份由矩阵样式配置组成的 Jenkins 工作。我想运行一个脚本来确定是否应该运行该组合(类似于组合过滤器,但是是动态的)。因此,将作业设置为“不运行”(灰色)或在其上运行其余脚本并生成结果。

有没有办法(或插件)来做到这一点?如果没有办法在作业开始运行后将其设置为“不运行”?

干杯, Stu

编辑:讨论位于:

http://groups.google.com/group/jenkinsci-users/browse_thread/thread/d99e865b17575e92/6c83ee0f894980fb?lnk=gst&q=dynamic#6c83ee0f894980fb

建议两个插件,但也许是一个查看先前构建的 pre 脚本就像 简单的。

I have a Jenkins job consisting of a matrix style configuration. I want to run a script that determines whether that combination should be run (similar to the combination filter, but dynamic). Thus setting the job to 'No Run' (grey) or running the rest of the scripts over it and producing a result.

Is there a way (or a plugin) to do this? In the event there isn't is there a way to set a job to 'No Run' once it has started running?

Cheers,
Stu

Edit: Discussion at:

http://groups.google.com/group/jenkinsci-users/browse_thread/thread/d99e865b17575e92/6c83ee0f894980fb?lnk=gst&q=dynamic#6c83ee0f894980fb

Suggests two plugins, but perhaps a pre script looking at the previous build is just as easy.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

走野 2024-12-10 03:57:14

我也做过同样的事情。

我无法在矩阵过滤器功能中做到这一点,因为它不是动态的。

所以我所做的就是添加到我的构建脚本 2 groovy(前和后),它决定是否应该完成构建。

第一个脚本查找旧的构建执行日志文件,以确定当前构建是否应该完成,并将状态保存在工作区根目录下名为“disabled”的文件中。

仅当禁用文件不存在时,构建过程才会继续。

第二个 groovy 脚本是存储特定构建已完成的信息,并将其存储以供进一步执行并删除文件。

通过这种方法,我可以进行 50 个配置的循环构建,每天 6 个。

我补充的唯一问题是所有构建都已启动,因此所有构建都是绿色的,我们无法快速查看哪个构建已真正完成。

问候,

卢多维奇·斯玛贾
JALIOS - 研发
http://www.jalios.com

I've done the same things.

I can't do that in matrix filter feature because it's not dynamic.

So what I've done is to add to my build script 2 groovy (pre and post) which determinate if the build should be done or not.

The first script look for a old build execution log file to determine if the current build should be done or not and save the state in a file named disabled at the root of the workspace.

The build process only continue if disabled file is not present.

The second groovy script is to store that a particular build is done and store it for further execution and remove the file.

With this method, I can do a round-robin build of 50 configuration, 6 per day.

The only problem I add is that all build are launched so all are green, and we can't quickly see which build have been really done.

Regards,

Ludovic SMADJA
JALIOS - R&D
http://www.jalios.com

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文