1

I have a separate job to build a project during the night. But I 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"?

Maksim Sorokin
  • 2,334
  • 3
  • 34
  • 61

1 Answers1

1

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).
RichN
  • 6,181
  • 3
  • 30
  • 38
  • I do not quite understand what are you suggesting. I want to build the project **only** during the night. I do no want to build the project immediately when a snapshot dependency is changed. – Maksim Sorokin Apr 28 '11 at 09:44
  • 1
    Edited my answer, I hope it's clearer now. I had assumed that the configuration started from the default. – RichN Apr 28 '11 at 11:19
  • If I have project A dependent on project B, your solution assumes that I have two nightly build jobs -- one for project A and another for B? What I want to have is two jobs -- one nightly build job for project A and another "ordinary" (on scm change) one for B. – Maksim Sorokin Apr 29 '11 at 15:09
  • Then just create a new Hudson job for the same project. So now you have A, B, B'. – RichN May 03 '11 at 04:36