How do I trigger another job from hudson as a pre-build step?

HudsonJenkins

Hudson Problem Overview


How do I trigger another job from hudson as a pre-build step?

Hudson Solutions


Solution 1 - Hudson

There is a Parameterized Trigger Plugin, which enables "Trigger/call builds on other projects" in "Add build step" menu.

Solution 2 - Hudson

You can use the plugin at http://wiki.jenkins-ci.org/display/JENKINS/Join+Plugin

Basically you create 3 jobs:

A = your prebuild ste

B = your main job

C = your trigger.

You 'build' C. It calls A, and once A is successful, it calls B. The plugin page gives you more information. The good thing about this plugin is that you can have any number of pre-build jobs.

We actually have a set of 5 pre-build jobs before our main is run.

================================================

If you don't want to try that:

If you are using Linux, you can do the following from within your "shell" script:

wget http://yourserver/hudson/job/MyJob/build?delay=0sec

This will trigger the job. The bad part about this is that it will not wait for the job to finish.

Solution 3 - Hudson

Actually I know how to answer to your question: This is the plug-in that you need:

PreBuild

It is not widely famous, but it does what you want.

It basically runs a Build before your chosen one. For example: You want A to run before B. You click on "run B" it will execute A before running B.

Pro: -> Very versatile -> Easy to use

Cons: -> No support / Option in case the pre-build fails (e.g. do not build if pre-build fails) -> The development seems not being that active at all.

Here you can see how it looks like enter image description here

EDIT

This answer is back from '12, I know you are down-voting it, but back then this was a reliable solution, now I am sure there are other plug-ins that do the job.

Solution 4 - Hudson

I have the same issue and I found a way to do:

I am using jenkins version jenkins-1.452-1.1.

Say I have job A and B, and Job A is depending on job B. When building job B, I want A triggered automatically, and B is blocked until A build successfully.

When define build configuration in build section, I add 'trigger build on other projects'. then fill the form.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionsorinView Question on Stackoverflow
Solution 1 - HudsonDraco AterView Answer on Stackoverflow
Solution 2 - HudsonSagarView Answer on Stackoverflow
Solution 3 - Hudson7dr3am7View Answer on Stackoverflow
Solution 4 - HudsonDustinView Answer on Stackoverflow