jenkins: pass variable from one job/project to another

In the parent job configure, add parameters by clicking on “This project is parameterized”

param1

Then in post-build step add “Trigger parameterized build on other projects”

Then add the parameters as follows:
param2

In the child job/project again add parameters:
param1

Then access the parameter in the job as $parameter-name

If the parameter’s value is to be calculated via shell command then:

install Environment Script Plugin. Then in the job add the following in “Build Environment” section.

param3

Only the variables you echo will be available.

Advertisements

One thought on “jenkins: pass variable from one job/project to another”

  1. whoah this blog is wonderful i love studying your articles. Stay up the good paintings! You recognize, a lot of persons are searching around for this info, you can aid them greatly.

    Liked by 2 people

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s