user438604
user438604

Reputation: 51

Jenkins autobuild goes into a loop when github commit triggers the build

I created a webhook in jenkins and connected it to github webhook & services.

I came upon the following issue When the build is completed, the pom.xml is updated with the version and tag . This triggers build job again and its goes into a loop until, I manually stop it .

I have set the build trigger to "Build when a change is pushed to GitHub"

I would like to find out how to stop the build trigger when the pom.xml is updated only as part of the build?

Upvotes: 3

Views: 2478

Answers (2)

Ivory Micky
Ivory Micky

Reputation: 581

In the source code management job configuration section add Additional Behaviors and select Polling ignores commits from certain users and provide the user name your Jenkins job uses to checkin pom.xml. You can also use Polling ignores commits in certain paths and provide path to pom.xml.

Upvotes: 1

Sergej Koščejev
Sergej Koščejev

Reputation: 790

I'd suggest not committing the version update to the master branch but create a separate tag every time. Something like this:

    v1   v2   v3
   /    /    /
--A----B----C (master)

I got this approach from Real-World Strategies for Continuous Delivery with Maven and Jenkins video (corresponding slides) - it contains other tips on setting up build pipelines with Maven as well.

Upvotes: 0

Related Questions