Confusing YAML files, long feedback cycles and rigid structures make it difficult to react flexibly to new requirements.
Atlassian has recognized this problem - and has fundamentally revised the structure of workflows in Bitbucket Pipelines. At the center of this is a new function: Triggers.
As an Atlassian partner, we show in this article what the new trigger model is all about, what advantages it brings for development teams and how you can immediately benefit from more modularity and transparency.
With triggers, you can no longer limit pipelines to classic selectors such as branch names or pull requests. Instead, you define event-driven rules that are checked for certain actions (e.g. push or pull request update). If defined conditions are met, all assigned pipelines are executed in parallel.
This enables
The new structure is based on a top-level triggers block in the bitbucket-pipelines.yml file. Within each trigger, you can define one or more conditions. If a condition is fulfilled for an event, all referenced custom pipelines are executed simultaneously.
This is made particularly powerful by
triggers:
repository-push:
- condition: BITBUCKET_BRANCH == "main"
pipelines:
- unit-tests
- scan
- deploy
pullrequest-push:
- condition: glob(BITBUCKET_BRANCH, "feature/*") && BITBUCKET_PR_DESTINATION_BRANCH == "main"
pipelines:
- unit-tests
- lint
- condition: glob(BITBUCKET_BRANCH, "hotfix/*")
pipelines:
- unit-tests
Each condition checks variables such as branch names or target branches for pull requests. If the criteria are met, the specified pipelines are started - not just one, but all that apply.
|
Aspect |
Classic selectors |
New triggers |
|
Matching behavior |
First match wins |
All matching pipelines run in parallel |
|
Complexity of conditions |
Simple |
Logical expressions, patterns, comparisons |
|
Multiple pipelines per event |
Not possible |
Any number, simultaneously |
|
Build status |
One common status |
Separate status per pipeline |
The new trigger model offers several concrete advantages:
The good news is that you can get started straight away - without having to switch off the previous model. Both systems work in parallel. However, it is advisable to switch to the new trigger model gradually in order to benefit from the advantages in the long term.
Important to know:
Would you like to find out more about the new trigger workflow? As an Atlassian partner, we will be happy to advise you.