问题
I have a Jenkins build configured to pull from a Gitlab repo.
I have specified in the build config, branch specifier to only pull from one specific branch:
Branch Specifier (blank for 'any'): origin/development
Yet regardless of which branch a commit is pushed to, the build still triggers and pulls the committed branch and builds it.
Am I misunderstanding exactly what the branch specifier is supposed to do? I want to only build when a certain branch is committed to.
I've also tried the following branch specifiers with the same results:
development
*/development
refs/head/development
回答1:
I figured out the issue (sort of).
Under the Build Triggers option, I specified to only match certain branches.
Filter Branch By Regex: development
回答2:
Same, whatever I put in "branch specifier" : master. But push on every Git branches still to trigger a build. (And the worst thing is that it don't only build sources from master).
Under "Comment for triggering a build" -> button advanced : "Filter branches by name" : I wrote "master" and saved.
Now only push on master trigger a build.
来源:https://stackoverflow.com/questions/38423612/jenkins-branch-specifier-not-being-obeyed