sansari
sansari

Reputation: 558

Continuous integration creates a build loop

I have a Webhook for my repository in github which is triggered when there is a push to master branch and then webhook starts the build in Jenkins

At the end of build process, I change the version in the pom and push it to master again which would trigger the webhook again and make a loop of builds in Jenkins.

Is there something I can do about this? What is the better practice for this scenario?

Thank you

Upvotes: 1

Views: 1585

Answers (2)

Renzo Disi
Renzo Disi

Reputation: 26

When you deliver a new change you can commit with a specific message like ('pom modified from jenkins build'). Then add a rule in Jenkins Git plugin to ignore commits with that message ("Polling ignores commit with certain messages" using exact or a pattern). This way you avoid an infinite loop!

Upvotes: 1

VonC
VonC

Reputation: 1328742

Try and break the loop by pushing the updated pom to a dedicated "release" branch from which the final release is built (and the webhook you mention is not active)

From there, any new development should first merge the latest release (and get the updated pom), before making new commits for the next feature to merge to master.

Upvotes: 0

Related Questions