Hi, I'm trying to export steps from a bitbucket-pipelines.yml to another repositories so I can reuse them. Here is the approach I've been trying, but hasn't been able to use the anchor tags correctly.
Source pipeline (share-template)
export: true
definitions:
pipelines:
share-step-build:
- step: &build_docker_image
name: 'Build Docker image'
script:
- echo "Build docker image step"
share-step-push:
- step: &push_into_ecr
name: 'Push Into ECR'
script:
- echo "Push into ECR step"
Import pipeline
definitions:
steps:
- step: &build_docker_image
import: share-template:main:share-step-build
- step: &push_into_ecr
import: share-template:main:share-step-push
pipelines:
branches:
main:
- parallel:
steps:
- step:
<<: *build_docker_image
- step:
<<: *push_into_ecr
When I try this approach I get the following error:
No commands or pipes defined for the step at [pipelines > branches > main > 0 > parallel > steps > 0 > step]. Check that you have defined a valid "script" section.
What would it be the correct way to import these steps, so i can reuse them in my second pipeline using anchors and tags?