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

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Can not use yaml anchors in pipeline

Hey All!

 

I'm pretty new to bitbucket pipelines, so the following may seem trivial but anyway..

Tryin to declare the following bitbucket-pipelines.yml file:

definitions:
steps:
- step: &black
name: Black Format Check
image: python:3.7
script:
- pip install black
- black --check .
- step: &mypy
name: mypy Check
image: python:3.7
script:
- pip install mypy
- mypy src
- step: &flake8
name: flake8 Lint Check
image: python:3.7
script:
- pip install flake8 flake8-bugbear
- flake8 -v .
- step: &pylint
name: pylint Lint Check
image: python:3.7
script:
- pip install pylint
- pylint src


pipelines:
pull-requests:
feature/*:
- parallel:
- step: *black
- step: *mypy
- step: *flake8
- step: *pylint

 But the pycharm states that

Schema validation: Property 'parallel' is not allowed

Interesting considering when checked using the online validator I see it's valid :\

Have I miss used yaml anchors?

 

Thanks in advance for your help :)

1 answer

1 accepted

@Soumyadeep Mandal - SaM Thanks a lot!

Appreciate your quick & informative response :)

 

For the record, problem was that I declared the  steps as list items.

Fix was to convert them to sub keys:

definitions:
black-step: &black
name: Black Format Check
image: python:3.7
script:
- pip install black
- black --check .
mypy-step: &mypy
name: mypy Check
image: python:3.7
script:
- pip install mypy
- mypy src
flake8-step: &flake8
name: flake8 Lint Check
image: python:3.7
script:
- pip install flake8 flake8-bugbear
- flake8 -v .
pylint-step: &pylint
name: pylint Lint Check
image: python:3.7
script:
- pip install pylint
- pylint src


pipelines:
pull-requests:
feature/*:
- parallel:
- step: *black
- step: *mypy
- step: *flake8
- step: *pylint

Thanks again!

Like Soumyadeep Mandal - SaM likes this

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket

Powering DevOps with Bitbucket Server & Data Center

Hi everyone, The Cloud team recently announced 12 new DevOps features that help developers ship better code, faster   ! While we’re all excited about the new improvements to Bitbucket ...

2,575 views 1 9
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you