1

I currently have Jenkins set up to build several jobs, each of which builds a number of c# projects, creates NuGet packages for them then deposits them in a local folder on the build server (I'm not publishing them to a URL), so they can be imported into jobs further down the line, eventually ending up with jobs that build applications themselves requiring the packages.

To do this, I'm using the build trigger 'Build after other projects are built' in each project to form a dependency graph (NB: I'm not using pipelines / pipeline scripts). This is working fine unless the project has multiple upstream parents. Consider the situation below:

Jenkins jobs

Jenkins will build Job 1, which will trigger builds for jobs 2 and 3. These will build in parallel. The problem is Job 4 will start building when 2 finishes, but will fail as job 3 hasn't built yet and its NuGet packages won't exist. Furthermore, if job 4 does build (which will be relying on a possibly outdated job 3 build) then Job 4 gets built twice, as it is also triggered by job 3, which will 'fix things' but be inefficient.

Is there a way to make it so that I can make job 4 wait for 2 and 3 to complete in this case, and only build once? I would also still like to be able to trigger job 2 and get it to build job 4 without having to trigger job 3 as well.

Symo
  • 466
  • 4
  • 16
  • Maybe this helps https://stackoverflow.com/questions/9012310/how-do-i-make-a-jenkins-job-start-after-multiple-simultaneous-upstream-jobs-succ – fishi0x01 Jan 22 '19 at 15:26

0 Answers0