Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Making Jenkins (Hudson) job depend on another job

Tags:

I have two jobs:

  1. Upload
  2. Launch-instance

I want to make Launch-instance dependent on the other one, so that triggering Launch-instance automatically causes Upload to be run first.

Can I achieve this using built-in Jenkins features or with a plugin?

Note that I do not want Upload to always trigger Launch-instance, which is what the "Build after other projects are built" option on Launch-instance would do. What I want is more analogous to how depends attribute works in Ant.

like image 913
Jonik Avatar asked Apr 20 '10 11:04

Jonik


People also ask

How do I create a dependent job in Jenkins?

You can use the downstream or upstream dependencies. You should use "Build Triggers" -> Build after other projects are built and/or post-build actions in the configure part of the project. You have to add "Build-Trigger"-> Build after in the "Update" project and enter "Launch-instance" there.

What kind of Jenkins job does your seed job need to be in order to use it?

The seed job is a normal Jenkins job that runs the Job DSL script; in turn, the script contains instructions that create additional jobs. In short, the seed job is a job that creates more jobs. In this step, you will construct a Job DSL script and incorporate it into a seed job.

How does Jenkins determine job type?

On Jenkins' Dashboard, each project type has a different icon representation on the left of the project table. For example, Folder project has a Folder icon. When you hover your mouse over the icon, it will show a tooltip that is the project type.


1 Answers

Have you tried the Parametrized Trigger Plugin?

You can use it as a build step, and mark the checkbox for "Block until the triggered projects finish their builds". That should be exactly what you are looking for.

like image 108
pushy Avatar answered Jan 19 '23 12:01

pushy