Re: Jenkinsfile merge conflicts because difference between branches

2016-08-08 Thread Alan Clucas
So you are unwilling to *provide* a mapping between branch name and slave nodes. You must therefore work it out by using your version control system to work out where you're derived from and use the mapping for that branch (if it has one, else iterate up again until you find it?) On Monday,

Re: Jenkinsfile merge conflicts because difference between branches

2016-08-08 Thread Sverre Moe
Yes, one solution would be to store the branch names elsewhere which environment to build on. However that solution would deprive me of a great functionality to automatically build new branches. If I create a new branch origin/fixA from origin/featureA, then I would have to manually update a gr

Re: Jenkinsfile merge conflicts because difference between branches

2016-08-08 Thread Alan Clucas
Ok, so you're either in to doing this with git (I'm guessing you use git) to work out what derived branch you're from, which is very hard in the general case - or you need to store branch names elsewhere. You could perform a load(env.BRANCHNAME+'.groovy') to load a branch specific groovy snippe

Re: Jenkinsfile merge conflicts because difference between branches

2016-08-03 Thread Sverre Moe
Yes, I am using Multibranch pipeline. I already have the branch name with env.BRANCH_NAME, but only some designated branches have a list of slave nodes. If the branch is master, it should build on all slave nodes in the environment for master. If the branch is userName/work which is branched out

Re: Jenkinsfile merge conflicts because difference between branches

2016-08-02 Thread Alan Clucas
How are you building all these branches? If you're using a multibranch pipeline (or anything else where the branch name is part of the job name) then env.JOB_NAME contains a string you can mangle to extract the branch details. On Tuesday, 2 August 2016 07:19:22 UTC+1, Sverre Moe wrote: > > I am

Jenkinsfile merge conflicts because difference between branches

2016-08-01 Thread Sverre Moe
I am using the variable buildEnvironment to determine which set of nodes the branch should be built on. Each release branch (including git master) has their own list of slave nodes. Jenkinsfile: #!groovy def buildEnvironment = "master" def param2 = null String[] args = [buildEnvironment, param2