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?
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 .
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.
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With