Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Parametrized job using build pipeline plugin on Jenkins

I've been using build pipeline plugin with Jenkins (v1.534) for a long time now and recently I've tried to create a pipeline with the same job (using different parameters) twice and it seems not possible. It looks like this:

Job A (param env=dev) -> Job B -> Job A (param env=qa)

Is this possible using build pipeline plugin (v1.4)?

like image 810
Fabricio Leotti Avatar asked Oct 15 '13 11:10

Fabricio Leotti


People also ask

How do you parameterize in Jenkins pipeline?

Using build parameters, we can pass any data we want: git branch name, secret credentials, hostnames and ports, and so on. Any Jenkins job or pipeline can be parameterized. All we need to do is check the box on the General settings tab, “This project is parameterized”: Then we click the Add Parameter button.

How do you use a parameterized remote trigger plugin?

Type the name of the job which you want to build on remote jenkins server i.e. “TEST” job on JenkinsTwo server in our case. Specify the parameter i.e “NAME” required by the “TEST” job. Also, we need to use the value defined here in “name” parameter as shown below. Save your configuration changes.

Which of the following plugins let you add parameterized jobs in Jenkins?

For example, use EnvInject Plugin to process values or use Extensible Choice Parameter Plugin which provides a choice parameter accepting edited values.


2 Answers

You can try the Jenkins FLOW plugin... https://wiki.jenkins-ci.org/display/JENKINS/FLOW+Plugin

like image 188
user2888225 Avatar answered Oct 15 '22 10:10

user2888225


I think this is only possible if you have Job B automatically setup to trigger job A again, not manual build step.

Job B will automatically trigger downstream via the parameter trigger job plugin. This works fine if you use the automatic build downstream, but the manual hold feature post build job is not smart enough yet to continue on.

Jenkins also has massive failing in plucking upstream variables into downstream jobs, like if jobs are run out of order on a pipeline.

At my work, I duplicate jobs and chain them Build->Deploy to Dev->Deploy to QA->Deploy....XXX and so forth.

like image 1
Electrawn Avatar answered Oct 15 '22 10:10

Electrawn