Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bamboo selective branch deployment

Tags:

bamboo

I am using Bamboo and have two branches: branch1 and branch2 as well as master.

When I build master the resulting artefact is deployed to a nexus repository as expected. However, when I build any of the branches they too get deployed to nexus.

Ideally what I want to happen is that only master is deployed to nexus.

Since both master and the branches use the same stage/job how would you configure this?

like image 292
Mike Chinaloy Avatar asked Jan 06 '15 16:01

Mike Chinaloy


People also ask

How do I deploy a specific branch in git?

To where you wish to deploy. Run git checkout -b deployment origin/master . Make your changes (push them if you like). Whenever your master (or whatever branch you made the deployment from) has changes you want to deploy, simply git pull --rebase .

What are Bamboo deployments?

A deployment project in Bamboo is a container for holding the software project you are deploying: releases that have been built and tested, and the environments to which releases are deployed. Teams typically have QA, staging and production environments.


2 Answers

In the end we settled on a solution which involved using branch variables. Using these we could then insert a value as a maven target i.e. mvn clean ${bamboo.variableName}. By default the variable had the value install but the master branch in Bamboo would override the variable and set it to deploy. This way all branches will just build and test whereas master would build, test and deploy.

like image 123
Mike Chinaloy Avatar answered Oct 29 '22 23:10

Mike Chinaloy


You should be able to select which branch is deployed when setting up an automatic deployment, documented here - https://confluence.atlassian.com/display/BAMBOO/Deployments+from+branches#Deploymentsfrombranches-Automatedbranchdeployment

like image 28
Adam Westbrook Avatar answered Oct 29 '22 22:10

Adam Westbrook