Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,455,373
Community Members
 
Community Events
175
Community Groups

Bitbucket Pipelines limit trigger to branches

I want to limit certain step to specific branches

pipelines:
branches:
'{feature/*,release/*,hotfix/*,bugfix/*}':
- step: # Generates credential needed for test and building
script:
- echo "All branch, this step is needed for release"
- parallel:
script: # Some lint and unit test script
- echo "All branch, this step is needed for release step"
'{release/*}':
- step: # Actual test and build script
script:
- echo "Only in release branch"


In the above sample I want the first step to run in almost all branch, but the second step should only execute for release branches pattern. Unfortunately the actual result was the first step only works in branches like hotfix and never gets trigger in release/version-name when branching out. How is it supposedly done? Basically the idea is to reuse the first two steps above on release branches, so no need to duplicate those steps.

 

1 answer

Hi Jensen, I think you should use yaml anchors to define the common steps and reuse them in the appropriate pipelines - `release/*` or `hotfix/*`.

Ref: https://support.atlassian.com/bitbucket-cloud/docs/yaml-anchors/

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS

Atlassian Community Events