0
votes

When a jenkins Job runs then its Upstream projects jobs(dependent projects jobs) will build automatically or we need to run upstream projects job separatly then this job ?.

When a job runs then its Downstream Projects jobs runs automatically or not ?

I have 4 jobs

Job-2,Job-3 depends on Job-1 .

Job-4 depends on job-1,Job-2,Job-3 .

note: job-1,job-2,job-3 java projects and job-4 web project.

I need JOB-4 as war then which job shall i run and How i configure jobs upstream ,downstream

1
Please provide more context : what have you already tried ? If you are using Jenkins pipelines provide some code too.Pom12

1 Answers

0
votes

The build flows from upstream to downstream. When you build a project it will trigger all downstream builds, but will not trigger upstream builds. So we say that a downstream project depends on an upstream project.

When you are configuring a build in Jenkins this will be very obvious. When you define job1, in the post build actions section you can tell it to Build other projects and select job2. Jenkins will automatically determine that job1 is upstream and job2 is downstream.

Even though job4 depends on all three other projects you should set it up so that only one project builds at a time. For you, Job1 -> Job2 -> Job3 -> Job4. This would mean that each project has at most one upstream project and one downstream project.

If you really want to make Job2 and Job3 run at the same time, but want to ensure that Job4 is called only once and only after both other jobs are finished, then you should look into the Build Flow Plugin which is designed to do exactly that.