MattDiMu
MattDiMu

Reputation: 5003

Force Jenkins to trigger separate builds for each branch event

I am using Bitbucket "Post Webhooks" to trigger Jenkins Builds on every push. When Jenkins is busy and commits are pushed multiple times within a short timeframe, it may occur, however, that Jenkins combines multiple branch events into 1 build.

Jenkins receives all branch events reliable and even shows all branch events responsible for a build within the build info. E.g:

Build #10 (Jul 27, 2022, 1:40:00 PM). Changes:

Events:

How may I prevent Jenkins from combining multiple events into 1 build and make him execute separate builds for each branch event instead?

Upvotes: 4

Views: 1000

Answers (2)

Hanan Zamalin
Hanan Zamalin

Reputation: 166

https://plugins.jenkins.io/generic-webhook-trigger/

You can solve this by making the one job parameterized. Resolve one of the parameters with something unique from the webhook. This will make each trigger unique and Jenkins will not batch the builds into one build.

https://github.com/jenkinsci/generic-webhook-trigger-plugin/issues/171

Upvotes: 3

Chedly Mejri
Chedly Mejri

Reputation: 31

I think you just have to set the quiet period to 0 on your pipelines.

Quiet Period: Quiet Period is the number of seconds that this Jenkins instance should be should wait before triggering a Job. The quiet period is important because suppose your job is auto-scheduled to run at some particular time, or the job can be triggered as soon they take place.

You can also look into this link for more information : https://www.jenkins.io/blog/2010/08/11/quiet-period-feature/

Hope this helps !

Upvotes: 0

Related Questions