5 branches: (master, develop, test1, test2, test3)
We need to triger a build only from two branches: (master, develop)
If we leave field "Branch Options" with parametr "Build all" - it will build from all branches
If we leave field "Branch Options" with parametr "Build from" - master - it will trigger to build Jenkins from master branch, same with develop.
But how to limit the trigger to be triggered only from 2 branches:
We've tried these options:
master, develop
master develop
origin/master, origin/develop
There are two ways to achieve that:
Select “Build from“ and enter branch names separated by white space: “master develop“
Select “Build RegExp“ and enter regexp based expression: “master|develop“
Note:
Jenkins jobs must be configured for the branches.
Yes, branch parameter can be set when using integration with Git Plugin. On hook settings set “Parameters“ field to this:
TARGET_BRANCH={BRANCH}