I have a separate job to build a project during the night. But I 开发者_StackOverflow中文版only want to build it if the code of the project is changed or snapshot dependency of the project is built.
Building a project nightly when codebase was changed can be achieved using SCM polling schedule. But how I can combine it together with "Build whenever SNAPSHOT dependency is built"?
I assume that those snapshots also exist as jobs in your Hudson. (if this is false, please say so in the comment)
- For each project, do a nightly SCM polling (like you have done).
- In dependent jobs, go to Build Triggers and tick Build after other projects are built (it's directly under "Build whenever a SNAPSHOT dependency is built") and enter those snapshots projects you mentioned. Do not tick the "Build whenever a SNAPSHOT dependency is built".
- Go to Advanced Project Options and tick the Block build when upstream project is building.
- You may also want to space out the polling time, so if the first one is "0 0 * * *", the next one can be set to "0 1 * * *" (i.e., 1 hour after the next).
精彩评论