Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

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

Felipe Reis
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 20, 2013

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

1 vote
Answer accepted
Felipe Reis
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 24, 2013

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!

PiotrA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 24, 2013

:) you were faster than me

baratrion November 24, 2016

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

 

0 votes
PiotrA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 24, 2013

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?

0 votes
Felipe Reis
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 24, 2013

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!

0 votes
PiotrA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 22, 2013

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?

0 votes
Felipe Reis
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 22, 2013

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.

0 votes
PiotrA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 20, 2013

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?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events