You can handle branches in Bitbucket Pipelines by adding branch-specific configuration in your bitbucket-pipelines.yml file.
Let's say that your bitbucket-pipelines.yml file looks like this:
That example shows two branches based on the master branch:
- a branch called feature/BB-123-fix-links that is a feature branch
- a branch called experimental where your team can go crazy innovating and breaking stuff. This branch is not a feature branch.
The same bitbucket-pipelines.yml file lives in the root directory of each branch. On each commit to a branch, Pipelines executes a set of scripts assigned to the branch in the bitbucket-pipelines.yml file:
- master contains build instructions that are executed on a commit to master
- feature/* contains build instructions that are executed on a commit to any feature branch (that's our BB-123-fix-links branch)
- default contains build instructions that are executed on a commit to any branch that is not master or feature (that's our experimental branch)
Note that the branch builds are triggered only if the bitbucket-pipelines.yml file requirements for a branch are met.
Was this helpful?
Thanks for your feedback!