Bamboo build plan in a loop after using maven release


I have a bamboo CICD pipeline using maven build and release. Have created a trigger of type "Repository triggers the build when changes are committed" and my repository is Stash.

Whenever there is a change in my repository, build pipeline is getting triggered. Last step of my build pipeline is maven release which updates and checks in the pom file. This check-in is in turn invoking the pipeline resulting in a loop. Is there any way this loop can be stopped  by not invoking the pipeline for pom file changes checked in by bamboo?


2 answers

1 accepted

0 votes
Answer accepted

Since this issue was due to the commit message format. I had added a custom commit message in commit hooks and allowed maven release to check-in the files using default commit message beginning with [maven-release-plugin]. This resolved the issue.

This can be achieved via the advanced option Include/Exclude Files when you configure a source repository in Bamboo, see section 'Change detection options' within Bitbucket Server (formerly Stash):

Allows you to specify the files that Bamboo should, or should not, use to detect changes. When you configure the Include option, it means that you want Bamboo to use only the mentioned files for change detection (by default Bamboo checks all the files). In the same way, if you configure the Exclude option, Bamboo will not consider the excluded files when detecting changes.

Enter into File Pattern a regular expression to match the files that Bamboo  includes or excludes. The regex pattern must match the file path in the repository. See this page for examples.

Hi Steffen, Thank you for the response. Guess the above mentioned option excludes matching files checked in by all users but I need to exclude only the checkins made by Bamboo. When a user checks in pom file, build should still be triggered automatically. Is it possible to ignore checkins made by Bamboo alone?

From the information I have got, Bamboo always ignore the commits starting with "[maven-release-plugin]" by default. Since I had pre commit hooks which checks for the commit messages, I have added a different commit message for the files checked in by maven release. This might be a reason why Bamboo is not ignoring these checkins. 

Is there any way that Bamboo can ignore commits with certain pattern? 

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Wednesday in Opsgenie

Getting the Most out of Atlassian and Opsgenie Together

We’re excited to invite you to this action-packed webinar where we will demonstrate how to integrate Opsgenie’s powerful alerting and on-call management tools with your entire Atlassian stack. Mar...

63 views 0 0
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you