Some of our jobs use the following script in a build step to set the build number of the downstream jobs:
echo **** Keep build numbers in pipeline consistent ****** "C:\Program Files (x86)\Curl\curl.exe" -d "nextBuildNumber=%BUILD_NUMBER%" http://user:password@localhost:8080/job/DOWNSTREAM_JOB1/nextbuildnumber/submit "C:\Program Files (x86)\Curl\curl.exe" -d "nextBuildNumber=%BUILD_NUMBER%" http://user:password@localhost:8080/job/DOWNSTREAM_JOB2/nextbuildnumber/submit This uses the nextbuildnumber<https://wiki.jenkins-ci.org/display/JENKINS/Next+Build+Number+Plugin> plugin. [a different] Chris Williams Dell | PG Release Engineering From: jenkinsci-users@googlegroups.com [mailto:jenkinsci-users@googlegroups.com] On Behalf Of Eric Wood Sent: Thursday, July 31, 2014 6:39 AM To: jenkinsci-users@googlegroups.com Subject: Re: How do i pass a build number to a downstream job for jobs that are part of a Build Pipeline Chris: Thanks for the reply. Not sure i fully understood the steps. Can you elaborate? Where do i set a Predefined parameter and are you saying that once the variable is predefined I can merely reference the variable using the ${MYBUILD_NUMBER} in the downstream job? On Wednesday, July 30, 2014 10:20 AM, Chris Williams <sailingar...@gmail.com<mailto:sailingar...@gmail.com>> wrote: Hi, I usually add a "Predefined parameter" something like MYBUILD_NUMBER=${BUILD_NUMBER} and use that environment variable (Parameter) in the next build step..... Chris On 30 July 2014 15:13, Eric Wood <eric.w...@rocketmail.com> wrote: I use the build pipeline to manage a series of related jobs (downstream). I want to be able to pass the build number from the upstream job to be used in the downstream jobs as the build number there. How is this best accomplished. Thanks, Eric -- You received this message because you are subscribed to the Google Groups "Jenkins Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "Jenkins Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "Jenkins Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+unsubscr...@googlegroups.com<mailto:jenkinsci-users+unsubscr...@googlegroups.com>. For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "Jenkins Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.