We make heavy use of YAML anchors in our bitbucket-pipelines.yml files. We have a simple step named build-test which builds the bundle and runs unit tests. We want a separate deployment value set depending on the branch. With the following configuration
definitions:
steps:
- step: &build-test
size: 2x
deployment: test # I want to be able to override this
max-time: 15
name: Build
caches:
- node
script:
- echo "do something"
pipelines:
branches:
master:
- step:
<<: *build-test
deployment: production
develop:
- step:
<<: *build-test
deployment: test
I get the following error
There is an error in your bitbucket-pipelines.yml at [pipelines > branches > develop > 1 > step > script > 0]. Missing or empty command string. Each item in this list should either be a single command string or a map defining a pipe invocation.
Im using this as a reference: https://support.atlassian.com/bitbucket-cloud/docs/yaml-anchors/
This error is forcing me to define multiple steps which do the same thing.