运行前脚本以确定是否应运行 Jenkins 矩阵作业
我有一份由矩阵样式配置组成的 Jenkins 工作。我想运行一个脚本来确定是否应该运行该组合(类似于组合过滤器,但是是动态的)。因此,将作业设置为“不运行”(灰色)或在其上运行其余脚本并生成结果。
有没有办法(或插件)来做到这一点?如果没有办法在作业开始运行后将其设置为“不运行”?
干杯, Stu
编辑:讨论位于:
建议两个插件,但也许是一个查看先前构建的 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:
Suggests two plugins, but perhaps a pre script looking at the previous build is just as easy.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我也做过同样的事情。
我无法在矩阵过滤器功能中做到这一点,因为它不是动态的。
所以我所做的就是添加到我的构建脚本 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