When you are using the Delivery Pipeline plugin, and you have manually-triggered parameterized builds, as long as you configure the upstream job to pass along the parameters to the downstream job, when the "build trigger button" is clicked on the pipeline view page, the parameters are automatically passed along.
For instance, let's say you have a setup like this:
Compile_Project ---> Deploy_Project
Let's assume that you are passing a variable called versionNumber
from the Compile_Project
to the Deploy_Project
jobs. Let's also assume that you're using Subversion for your SCM, and your versionNumber
looks like 1.0.${SVN_REVISION}
. ${SVN_REVISION}
is automatically provided by Jenkins, so your version number will look something like 1.0.1234
, where 1234
is the commit number provided by Subversion.
On your Delivery Pipeline view, let's say that it's configured to show 3 pipeline instances, and that manual triggers are enabled in the view settings. Your pipeline view page might look something like this (yay ASCII art!):
Compile_Project ---> Deploy_Project (>)
Compile_Project ---> Deploy_Project (>)
Compile_Project ---> Deploy_Project (>)
In this case, I'm using (>)
to represent the manual trigger button. The button on the bottom would attempt to deploy version 1.0.1234
, the middle button would attempt to deploy version 1.0.1235
, and the top button would attempt to deploy version 1.0.1236
, assuming your project has gotten consecutive SVN commits.
In order to pass the parameter from the Compile_Project
to the Deploy_Project
job, you need to do the following. (Note: it sounds like you've already done this part, but I'm including it just in case you might have missed a step, and also for the sake of completeness.)
In the Compile_Project
job's configuration, as a Post-Build Action, choose "Build other projects (manual step)". In the "Downstream project names" box, enter Deploy_Project
, and then from the "Add Parameters" drop-down, select "Predefined Parameters". In the "Parameters" text area that appears, create a parameter to pass along, which I'll call VERSION_NUMBER
. What you'll enter in the text area is then VERSION_NUMBER=1.0.${SVN_REVISION}
. This will enable the parameter to get passed from the Compile_Project
to the Deploy_Project
. However, you're not quite done yet.
In the Deploy_Project
job's configuration, you need to set it up to accept the parameter you're passing into the job. To do so, configure the Deploy_Project
, and check the "This build is parameterized" checkbox. Then add a String parameter from the "Add parameter" drop-down. In the "Name" field, enter VERSION_NUMBER
. At this point, you can then use ${VERSION_NUMBER}
in the Deploy_Project
's configuration wherever you need in order to specify the correct version number of the project to deploy.