I am trying to reduce the amount of duplicated code in my .yml file. I've defined scripts at the top, then I try to reuse them in the different pipelines. I checked the syntax using the Bitbucket syntax validator and it was correct. The pipelines, however, do not build. I get the following error:
"There is an error in your bitbucket-pipelines.yml at
[pipelines > default > 0 > step > script].
To be precise: This section should be a list (it is currently defined as a map)."
Here's what I've been trying:
image: atlassian/default-image:2
options:
size: 2x
definitions:
scripts:
script_dependencies: &install_dependencies
- my steps
script_regular: &build_regular
- some more steps
script_release_candidate: &build_release_candidate
- some more steps
pipelines:
default:
- step:
script:
script_dependencies: *install_dependencies
script_regular: *build_regular
custom:
manual_run_release_candidate:
- step:
script:
script_dependencies: *install_dependencies
script_release_candidate: *build_release_candidate
Is there something wrong with this? Would appreciate some insight. Thank you.