I have multiBranch pipeline job, that triggered in each SCM change by this definition:
triggers {
pollSCM '* * * * *'
}
I want to trigger the build in each modification in develop/master/release branch, but not in feature branch. The feature branch build will trigger manually.
I tried to remove the triggers block from the jenkins files in the feature branches, but this make issues in the branch merge to develop.
I also tried to add filter by name to the behavior section in the multiBranch pipeline configuration, but this make the build of the feature branch disabled, and I want it to be enable and not run in each modification.
Thank for your replay.
Use filtering by wildcards gives the same results as regex - the feature branch build become disabled. and I want it to be enable and not run in each modification.
In the multi branch configuration I add branch filtering (regex or wildcards). so the main branches (develop, master and release) are running in each modification.
I add to the pipeline ( in JenkinsFile) string parameter that indicate the requested branch to build. By default, this parameter = env.BRANCH_NAME.
The logic use this parameter to load the correct branch.
The user can use “build with parameter” to run build in specific branch.
Open issue:
I try to use git parameter instead of string parameter, but the git parameter is affected by the SCM configuration, which is exclude the feature branches, so feature branches doesn’t appear in the list…
If you have idea how to resolve this open issue, or you have more elegant way to do this, I would like to here!