[Bamboo Knowledge Base]
Branching is an important tool in your development process, as it offers a very powerful way to let developers work in isolation on different aspects of a software project.
Plan branches represent a build for a branch in the version control system. The plan branch inherits all of the configuration defined by the parent plan, and any new branch created is automatically built and tested using the same build configuration as the parent. When the plan branch build succeeds, it can be automatically or manually merged back into master.
Branch deployments extend plan branches by allowing users to create a deployment release from any plan branch.
Learn more about branching strategies: Bamboo Best Practice - Branching & DVCSBamboo deployments allow a plan branch to be deployed to a non-critical test environment before the feature code is merged back to master. This means that the feature code can be thoroughly tested and evaluated in a real server environment before the developer merges back the changes to master.
Developers should consider using branch deployments whenever they want to keep their in-progress development code separate from the master code, but want to test it within a deployable environment.
Learn more about deployment releases and how deployment releases work.
The following diagram shows a typical deployment branch example.
Branch deployments should only ever be triggered into safe testing environments - they should never be triggered into production-like environments such as Staging, QA or Production.
Learn more about Creating and configuring a deployment project.
There are two typical strategies for managing branch deployments:
Let's examine each strategy in more detail.
Let's assume a developer is using a plan branch to work on a new feature for a product. They reach a point in development where the new code needs testing in a server environment.
Learn more about Manually starting a deployment.
Let's consider another developer who is also using a plan branch to work on a new feature for the product. They decide to automate the branch deployment so that it isn't triggered manually.
Remember: Plan branch code should only be merged back to master AFTER testing of the branch feature code is complete AND successful.
Learn more about Triggers for deployment environments.