Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,295,639
Community Members
 
Community Events
165
Community Groups

Scheme URL of bitbucket-pipelines.yml

Where to get Yaml scheme (usually json) of bitbucket-pipelines.yml?

3 answers

Actually you can find the schema here, as part of the vscode extension:

https://bitbucket.org/atlassianlabs/atlascode/src/devel/resources/schemas/pipelines-schema.json

However, it has a lot of problems, so I wouldn't rely on it.

If I have time I could submit a pull request for my issues, but I'm sure Atlassian could do a better job since they already have a pipelines validator.

Hi everyone,

Just an FYI: I recently made quite a few fixes and improvements to the schema @Lucian Mocanu linked to above, so hopefully it is now in a better shape.

Let me know if you have any questions.

Cheers,
Daniil

I would be nice if it supported steps definitions, like it was requested in that ticket too. We use them quite frequently, since we reuse steps in various pipelines.

I have a fix for that, but it was a quick solution that didn't consider other use cases, so I wouldn't feel comfortable making it public :)

Well, any piece of YAML can be reused, it's not limited just to steps. What I mean is that an anchor can be declared anywhere in the schema, and used later on. definitions object is just a conventional place to keep reusable pieces.

I don't think adding steps to definitions is a good idea. It'd only help with configs for some users, potentially small number of them. Others would want to reuse parallel, or maybe variables – should we add them do definitions too? Of course, we can add every single entity type as a possible child of definitions, but that would really clutter the schema.

Finally, validation should actually kick in where you use the anchor. That is, it will work as if the anchored bit is inlined. It then depends on how good the validator is in terms of whether the error it shows makes any sense (for instance, IntelliJ is not great here, I'm not sure about VS Code).

Especially since your own parser appears to reject yaml which adheres to the structure specified in your documentation.  It would be really nice if 'condition' worked as advertised, since there is no schema I can look at to see how it is supposed to be.  The docs cover it, but using it as specified results in an error

Hello @Sam Gendler

Can you provide an example which didn't work for you?

There is a more recent JSON schema than linked above – can you please check if your example is validated against it? However be aware that it is not an official schema for Pipelines configuration YAML either, and it is maintained on the best effort basis.

Let me know if this helps.

Cheers,
Daniil

0 votes
lassian Atlassian Team Jul 23, 2018

Hi Trurl,

We dont currently publish a schema for our yaml format :(

The closest we have is you could create one based on the description of our yaml as described here: https://confluence.atlassian.com/bitbucket/configure-bitbucket-pipelines-yml-792298910.html

Kind Regards,

Nathan Burrell

Sadly to read this. Why didn't you publish the schema?
It would be very helpful for developers all around the world.

Like # people like this

Suggest an answer

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

Git push size limits are coming to Bitbucket Cloud starting April 4th, 2022

Beginning on April 4th, we will be implementing push limits. This means that your push cannot be completed if it is over 3.5 GB. If you do attempt to complete a push that is over 3.5 GB, it will fail...

2,170 views 2 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