简体   繁体   English

如何在哈德森中指定必备职位

[英]How to specify prerequisite jobs in Hudson

I have a Hudson job that just does a check-out/update to a third-party library. 我有一个哈德森(Hudson)工作,它只对第三方库进行签出/更新。 Call this Job A. 将此职位称为A。

Several other jobs depend on this library. 其他几个作业也依赖于此库。 Call them Jobs B and C. They use the stuff checked out by Job A, and need it to be up-to-date. 称他们为工作B和C。他们使用工作A检出的内容,并且需要更新它们。

My question is, how can I require Jobs B and C to always run Job A (to update the library) before they run through their build routine? 我的问题是,我如何要求作业B和C在完成构建例程之前始终运行作业A(以更新库)?

If this is not possible, can someone recommend another way to achieve the same effect? 如果这不可能,那么有人可以推荐另一种方法来达到同样的效果吗?

You can do it the other way with "child" jobs. 您可以使用“子级”作业以其他方式进行操作。 For example, you can configure A to trigger B and C after it has succeeded. 例如,您可以将A配置为在成功之后触发B和C。 (You will find the option on job A configuration page). (您将在作业A配置页面上找到该选项)。

If you need more advanced conditions for triggering the child jobs, you can take a look at the Parametrized Trigger plugin . 如果您需要更高级的条件来触发子作业,则可以查看Parametrized Trigger插件

After thinking about the problem some more, I think I may have been over-complicating things. 在考虑了更多问题之后,我认为我可能使事情变得过于复杂了。

Since the library in Job A is rarely updated, we decided it's probably acceptable to just scan SVN on an interval and update when there are changes. 由于作业A中的库很少更新,因此我们决定只间隔扫描SVN并在有更改时更新就可以接受。 There's a small possibility that builds of B and C will miss library changes if they start right after the changes to A were checked in, but that should rarely be an issue. 如果B和C的构建在签入对A的更改后立即开始,则它们丢失库更改的可能性很小,但这很少有问题。

If I follow you, it sounds like you might need the Join plugin : 如果我关注您,听起来您可能需要Join插件

This plugin allows a job to be run after all the immediate downstream jobs have completed. 此插件允许在所有直接下游作业完成后运行作业。 In this way, the execution can branch out and perform many steps in parallel, and then run a final aggregation step just once after all the parallel work is finished. 这样,执行可以分支并并行执行许多步骤,然后在所有并行工作完成后立即运行最终的聚合步骤。 The plugin is useful for creating a 'diamond' shape project dependency. 该插件对于创建“钻石”形状项目依赖项很有用。 This means there is a single parent job that starts several downstream jobs. 这意味着有一个父作业启动了多个下游作业。 Once those jobs are finished, a single aggregation job runs 这些作业完成后,将运行一个聚合作业

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM