Multiple build ID's being determined and sent through to a child job

19 views
Skip to first unread message

Adam White

unread,
Apr 11, 2013, 3:47:47 AM4/11/13
to jenkins...@googlegroups.com
HI All,

I was wondering if anyone could provide me with advice on the following.

I have a job that triggers other job , when those other job have completed successfully. The Job that called those jobs will then trigger another job, this job is parametrized, Following that job successfully working, another job is triggered.

The idea is as follows:

Master Job Triggers
  • Job A - Web Component Build
  • Job B - Web Component Build

On Success of Jobs above.

Master Job Triggers

  • Job C - Deployment Job passing in JobA's Build ID and Job B's Build ID

On success of the Job above

Master Job Triggers

  • Job D - Web Component Test Tool

This all seems simple enough my issue is the capturing of the BuildID's. I need to capture Job A and Job B's build ID's and pass those values through to the parametrized Job C, so that Job C can determine which builds to package up and move onto a specified server. 

I was wondering if anyone knew of a way to successfully do this?

Thanks



cjo

unread,
Apr 11, 2013, 6:22:20 AM4/11/13
to jenkins...@googlegroups.com

One way to do this is to trigger job A & B from within a job using the Build/Trigger other projects buildstep with the blocking mode enabled (wait until triggered jobs finished). When using this there are Env variables (see the help for the block item or the wiki) created indicating the triggered projects, and build ids, which then can be passed to job C via the parameterized trigger.

Chris

Adam White

unread,
Apr 11, 2013, 9:53:36 AM4/11/13
to jenkins...@googlegroups.com
Thanks Chris,

I will give that a try, i ended up writing a quick console app in C# that took in the server url, the view, etc as arguments.

it would then get all the jobs from the view, using the Jenkins API,
it would then get the last successful build number from each job using the Jenkins api.

once it had all that information it calls the deployment job passing those parameters in.

Thanks for your response



--
You received this message because you are subscribed to a topic in the Google Groups "Jenkins Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jenkinsci-users/bAYMdQhG1WE/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to jenkinsci-use...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages