Bamboo: Can I prevent deployment of a plan branch on an environment?

I have configured Plan Branches for certain projects - easiest thing ever and shows a lot of potential.  However, I am not ready to allow feature branches to be deployed to production - in fact, I'd prefer if Plan Branches are only deployed to our Testing environment.

Is there a way to control this?  As you can see from the screen caps, it is equally easy to create a new build when deploying to my QA environment as my Stage environment.

I haven't seen any branch selector, or configuration, that would limit branch deployment per env.

Currently using Bamboo 5.3/4101.


Thanks for your help!


 Screen Shot 2014-12-18 at 1.14.11 PM.png Screen Shot 2014-12-18 at 1.15.06 PM.png

2 answers

I thought about this a bit more and figured out a solution.  I added a script task as the first step in my deployment job.  The script looks like this:

if [ "$BRANCH_NAME" != master ]; then
  echo "Cannot deploy non-master branch to production!"
  exit 127

I did this as an inline script and then in the arguments section I passed ${bamboo.planRepository.branch}.

This will cause the deployment job to fail if you try to deploy any branch other than master.  Obviously it would be nicer if it just wasn't a choice, but this gets the job done.

I'd like this feature too.  Can anyone comment that it's definitely not doable with the current Bamboo and I'll put in an enhancement request?

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
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,786 views 0 6
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