user1193091
user1193091

Reputation: 41

How to use Jenkins to build multiple version of branches on master server?

I am using Jenkins CI for automatic builds of my project version 2.9. Now I have to build 2.10 also. How do I setup 2.10 on Jenkins? Because the repository will be the same for 2.9 the build failed.

How to deal with that problem?

Upvotes: 4

Views: 2215

Answers (2)

Renat Gilmanov
Renat Gilmanov

Reputation: 17895

It is so easy to use "Copy existing job" option, but separate build configurations for similar builds will drive you crazy eventually. Let's imagine you need to tweak a configuration a little bit. Will it be OK for you to do it for 2 jobs, 5 jobs, 10?

Proper solution

If you want to have several separate jobs with similar configuration -- create a template job. Template Workflows Plugin will do the trick for you. It allows to create a template with some parameters and generate several jobs on the top of it, specifying certain values. Template changes will affect all subordinate jobs.

Template parameters example enter image description here

Concrete job creation enter image description here

Same rule as for development: do not use COPY&PASTE

Upvotes: 1

koljaTM
koljaTM

Reputation: 10262

You could either have two different build configurations for the different versions, if you plan to have both versions running alongside for some time, and need continuous builds for both branches, or configure the build with a parameter, if you only want Jenkins to do the deployment file.

Upvotes: 1

Related Questions