Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sharing configuration between jobs

I have got a few Jenkins jobs. They look very similar to each other and differ only in details. Originally they were created by copying the first job. If something changes in one of the jobs configuration, then it has to be applied to all the other jobs configurations. This makes Jenkins maintenance more complex, longer and error-prone.

What I'd like to do is to pull up at least some common parts of jobs' configuration and keep it in one place so I don't have to apply each configuration change to all the jobs separately. Is is possible, and if so, how can this be achieved?

I would like not to create new project or change the way jobs are structured (upstream-downstream dependencies) as all these jobs are legacy.

Thank you in advance!

like image 743
Mateusz Antkiewicz Avatar asked Feb 23 '15 13:02

Mateusz Antkiewicz


2 Answers

There are several plugins that help with that. Inheritance plugin comes to mind

like image 188
Slav Avatar answered Oct 02 '22 07:10

Slav


You can also have a look to the Template Project plugin.

With this plugin, you can use the builders, publishers and SCM settings from a template job.

We are using this plugin in my company and it works well :)

like image 35
Bruno Lavit Avatar answered Oct 02 '22 07:10

Bruno Lavit