Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hudson / Jenkins: share parameters between several jobs

I have about 20 jobs using common parameters (user, password), and sometimes the password expires... So I have to change it on all jobs, which is really time consuming (and error prone, I may forget one).

I thought about:

  • using a kind of magic property file if that exists to have directly lines like KEY, VALUE added into job parameters
  • adding the same kind of KEY, VALUE pair directly inside build.xml, but where ? And it's really ugly... Maybe with a dedicated XML embedded into the build.xml ?
  • calling a slave job that would (how ?) push up to the parent one the desired values...

As you can see I'm only starting in Hudson/Jenkins (I'm using Jenkins 1.424.2.2), thanks for your help !

EDIT: I'm not admin of the Jenkins instance, so I cannot have access to global properties...

like image 458
Emmanuel Avatar asked Sep 14 '12 15:09

Emmanuel


People also ask

How do I pass a parameter from one Jenkins job to another?

You can use Parameterized Trigger Plugin which will let you pass parameters from one task to another. You need also add this parameter you passed from upstream in downstream.

How do you transfer workspace and environment variables in a pipeline to the next job?

Under Build Environment check Set environment variables through a file. give the path of that file here. If the environment variable is created in the first job then again you can save all the environment variable in a file and browse it using the above method. Install this plugin and go to job configuration paeg.


1 Answers

Go to your Jenkins home and navigate :

  1. Manage Jenkins >
  2. Configure System >
  3. Global properties >
  4. Environment variables > ....
like image 143
Pulak Agrawal Avatar answered Sep 25 '22 03:09

Pulak Agrawal