Hudson / Jenkins: Share Parameters Between Multiple Jobs

I have about 20 tasks using common parameters (user, password), and sometimes the password expires ... Therefore, I have to change it to all tasks that really take a lot of time (and the probability of error, I can forget it).

I'm thinking of:

  • using the kind of magic properties file, if one exists, to have straight lines, such as KEY, VALUE, added to the job parameters
  • adding a pair of the same KEY, VALUE types directly inside build.xml, but where? And it's really ugly ... Maybe with dedicated XML embedded in build.xml?
  • calling a subordinate job that (how?) clicks on the parent's desired values ​​...

As you can see, I am just starting out in Hudson / Jenkins (I am using Jenkins 1.424.2.2), thanks for your help!

EDIT: I am not a Jenkins instance administrator, so I do not have access to global properties ...

+5
source share
3 answers

In the end, I managed to:

  • save encrypted credentials on a web page
  • extracting them in Hudson thanks to the shell script (wget), decrypting and creating the file build.propertiesin the workspace with lines name=value(in my case ssh.password=...)

This works because the Ant build steps detect this file and pass the variables internally to their context. Thanks to this, I could centralize my credentials.

0
source

:

  • >
  • >
  • a >
  • > ....
+6

:

  • , Jenkins. , .

  • script, , : http://[jenkinshost]/job/[jobname]/config.xml.

api http://[jenkinshost]/job/[jobname]/api, config.xml:

Fetch/Update config.xml

config.xml, [http://[jenkinshost]/job/[jobname]/config.xml]. POST config.xml URL-, - .

+1

All Articles