Don't build branch plan when merging to master or Don't build artifacts from branches

I am trying to setup a build that runs all my tests on the branches, but when merged into master it builds artifacts. I have tried several options but I am unable to get it to work exactly the way I want.

Right now I have two plans, but I think I should be able to combine them into one. My ideal plan would be a branch plan that runs all the tests on the branches, but does not build artifacts. Then when merged to master it would repeat the tests, and build the artifacts.

I am not able to achieve this because branch plans also build artifacts and I cannot seem to find a way to disable that.

I have also tried setting up two plans, one that builds branches without artifacts, and one that builds master with artifacts. However when merging to master it runs both plans. I think this is because in the branch plan I have master selected in the Repositories tab. I must select a branch in the Repositories tab because it is a required field, I also cannot select a different branch because all the other branches are feature or bug branches so they get removed when merging.

So I guess I have two questions.

  1. how can I setup a branch plan that only builds artifacts on master (not branches)? or
  2. how can I setup a branch plan to not build on the default (master) branch, only on the branches? (I have already tried the "Only create branches that match" option, it doesn't work because master is the main branch for the default stage)

2 answers

I've been searching for an answer to this problem for over a year.  Interested in hearing an answer.  Our "master" plan does a 'mvn deploy' and pushing branch work into our Maven Repository for branches is not acceptable.

Same problem. Surely this is a common issue? This JIRA issue seems relevant:

0 votes

Same problem here, bamboo currently  build artifacts when I push a branch release/X.X.X, and it works good. Then I expect to merge on master and re-use this artifact (to retrieve my custom version tag in the branch name).

But when I merge the release branch into master, bamboo triggers another build phase, and it overwrites my previously created artifacts. So I don't have my version number anymore.

Tried all day to workaround this, can't find a way.  It seems like a pretty common release flow, why is it so hard ? 

Suggest an answer

Log in or Join to answer
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,079 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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot