Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Injecting more than one properties file into a Jenkins job

Right now I'm using EnvInject plugin to insert my environment variables through a properties file into my Jenkins job.

However, now I have a second job which needs the same environment variables as the first job and than some more additional variables which I would like to load via another properties file.

I know, there is a possibility to insert the values via Properties Content Edit field of the EnvInject-plugin, but I would like to keep it in a file, so it can be shared between jobs. But there seems to be no possibility to add a second properties file to EnvInject-plugin.

Is there any way to inject more than one properties file into a job or any other plugin, that could handle my scenario?

like image 590
ead Avatar asked Oct 25 '25 14:10

ead


1 Answers

There is a simple way to get around the limitation you have.
You should load each file in the Build section, as a build step.
Use the Inject environment variables build step, and load each file you want. You can add multiple files by setting up multiple build steps of this type.

This works well for me on a similar need.

like image 186
Eldad Assis Avatar answered Oct 27 '25 04:10

Eldad Assis