Reputation: 349
A project with Jenkins integration has selected option: Build when a change is pushed to BitBucket. Everything works as expected until some other branch is merged to master. In this case Jenkins triggers two builds. Has anyone experienced this issue?
Upvotes: 4
Views: 3003
Reputation: 5931
I have experienced the same issue only for master branch, like you. The solution that worked was to update Build Triggers
configuration of the job that was triggered twice by leaving Poll SCM -> Schedule
text box empty (no Cron expression entered). So the proper configuration is to only mark the two trigger options:
[✓]
Build when a change is pushed to BitBucket[✓]
Poll SCM (leave the Schedule text box empty)In case Jenkins Job DSL plugin is used for generating the build job, it should contain proper triggers
block (which corresponds to the above screen):
triggers {
bitbucketPush()
scm('') // empty Cron expression string
}
Upvotes: 1