I am using Jenkins to create a build pipeline, and need to trigger a deployment step in the pipeline. This means a manual process (the build occurs automatically, timed, then stops at the deployment stage, waiting for manual authorization).
I need the deploy step to also be triggered with parameters from the prior step.
So, using the 'Parameterized plugin' I can pass parameters between jobs. I can trigger automated OR manually triggered downstream jobs (not sure if this is a standard feature, or manual builds was added by some plugin).
However, I cannot find any way to trigger a manual parameterized job.
Does anyone know of a way to do this? Is there another plugin I can use?
The reason I need the parameters is that I have created a generic deployment job, and need to pass in the module name, and maven version to deploy. I could create specific deployment jobs for each module, but this would be very painful.
I have also been considering the following, but it seems a kludge:
There are various problems with this approach
Current production version (1.4.2) of build-pipeline-plugin allows it - to specify manual downstream job with parameters, which is displayed on the pipeline and can be started from there. Old versions couldn't do it.
Take a look at the Build Pipeline Plugin: https://wiki.jenkins-ci.org/display/JENKINS/Build+Pipeline+Plugin.
You can specify jobs to be automatically triggered or manually triggered.
Also if you need parameter passing between jobs you will need to download the Groovy Plugin: https://wiki.jenkins-ci.org/display/JENKINS/Groovy+plugin
In order to pass parameters lets say an SVN revision between jobs you will need to Execute System Groovy Script at the start of your build. This is an example that will add a SVN_UPSTREAM parameter that can be used by any downstream jobs. NOTE: I have noticed a problem with creating a downstream job that also has a system groovy script. It seems to blow away any references to the original parameters created.
import hudson.model.*
def build = Thread.currentThread().executable;
build.addAction(new ParametersAction(new StringParameterValue("SVN_UPSTREAM", build.getEnvVars()['SVN_REVISION'])));
println "SVN_UPSTREAM:" + build.getEnvVars()['SVN_UPSTREAM'];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With