I see in the Bitbucket pipelines documentation that I can specify steps to run just on master, i.e.
branches:
master:
I want the steps in default: to run as well as the specific ones for master:
- Do I need to define those twice?
i.e. Do I need to do this, or is there a more efficient way?
pipelines:
default:
- step:
name: Step one
script:
- echo Step One Is Identical Both Times
branches:
master:
- step:
name: Step one
script:
- echo Step One Is Identical Both Times
- step:
name: Step two
script:
- echo Step two
Hi @Chris Doman ,
You can use YAML anchors for repeated sections, to make the file easier to read and also update:
E.g. the example you included would look like this with anchors:
definitions:
steps:
- step: &step-one
name: Step one
script:
- echo Step One Is Identical Both Times
pipelines:
default:
- step: *step-one
branches:
master:
- step: *step-one
- step:
name: Step two
script:
- echo Step two
Is this something that works for you? Please feel free to let me know if you have any questions.
Kind regards,
Theodora
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.