Why commits to branch trigger build on master (and not branch)?

Hi!

I'm using Bamboo+Bitbucket (git repo). I have a project with the master branch and a development branch called PII-25.

I have configured Bamboo to automatically detect new branches. So, when I created PII-25, Bamboo has received the message and successfully created a new build plan for that branch.

However, whenever I commit a change on branch PII-25 Bamboo triggers a build on the master plan, not on the PII-25 plan as expected.

Thanks!

6 answers

1 accepted

After Piotr clarified the issue for me, I was able to find a thread describing the same problem I was facing with a viable workaround.

The solution is to change the build trigger to "Polling the repository for changes".

Here is the thread that helped me: https://answers.atlassian.com/questions/135958/branch-specific-build-triggers

Thanks Piotr!

I'm having the same problem. So, the only option I have is to enable polling instead of remote triggering?

 

Hi Felipe,

That's weird - certainly Bamboo should build a branch PII-25 not the main plan if the commits are on PII-25 branch. What is your plan Triggers configuration?

I know Piotr,

I really don't know what I did wrong.

My trigger is of type "Repository triggers the build when changes are commited" on the master (main) plan. The branch plan inherits the same configuration, since the "Change trigger" option on the branch configuration is unchecked.

thanks for your comment.

Hm... how is your hook in the git repo configured? I mean, if you're using "Repository triggers the build..." Trigger, then you had to explicit set up git post-something-hook in your upstream git repository. How did you set it up?

I'm wondering if these hooks could be set up in a way that changes to both branches (master and to PII-25) would 'ping' the same URL in Bamboo, the one responsible for performing build of master plan. Care to shed some light as to how is your hooks set up?

Piotr,

Your last comment lead me straight to the problem cause. I'm using bitbucket as my GIT repo, so I didn't have to write any hook myself. Bitbucket has a simple configuration to enable commit triggered builds. I just have to type in my bamboo instance address, user, password and build plan key. So I have type my master build plan key, which is BPII-PII. So, it doesn't matter which branch was commited, Bitbucket will always tell Bamboo to build plan BPII-PII.

That leads me to a different question... Is it possible to configure Bamboo+Bitbucket in a way that commits trigger builds on different plans, according to the branch on which the commit was made?

Cheers!

Is it possible to configure Bamboo+Bitbucket in a way that commits trigger builds on different plans, according to the branch on which the commit was made?

Yes, but can I ask what are you trying to achieve? My first answer would be to persuade you to use a different Triggering strategy, like "Poll repository for changes", and use PlanBranches feature in Bamboo - like you probably have now. So the only difference would be that the Bamboo actively asks Bitbucket if there are new changes, instead of Bitbucket being the 'active' party informing Bamboo.

But I'm not sure if this is what you're trying to achieve. You say something about triggering builds on *different* plans - why do you need *different* Bamboo Plans per your git branch?

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Renan Battaglin
Published May 18, 2017 in Bamboo

FAQ: How to Upgrade Bamboo Server

Bamboo 5.9 will no longer be supported after June 12, 2017. What does this mean? As part of our End of Life policy, Atlassian supports major versions for two years after the first major iteratio...

1,493 views 0 5
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