Where to get Yaml scheme (usually json) of bitbucket-pipelines.yml?
Hello everyone,
Some good news for you: the JSON schema for bitbucket-pipelines.yml configuration file is now available at https://api.bitbucket.org/schemas/pipelines-configuration
Bitbucket Linky is already using it, AtlasCode will start using it soon, too.
Cheers,Daniil
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.
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.
Here is the ticket that you should watch for updates on this: https://bitbucket.org/atlassianlabs/atlascode/issues/66/yaml-validator-inconsistent-with-online
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.
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
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.
@Daniil Penkin I see you've been maintaining the Schema, but there is still a problem with the Artifacts...
The desire is to skip Downloads for a particular step that also doesn't publish an artifact
The "Artifacts" node, if in "complex" context, requires both "download" and "paths" with a minimum of 1 entry
Latest commit
artifact_list": { "type": "array", "description": "Files produced by a step to share with a following step", "items": { "type": "string", "description": "Glob pattern for the path to the artifacts" }, "minItems": 1},"complex_artifacts": { "type": "object", "properties": { "download": { "type": "boolean", "description": "Enables downloading of all available artifacts at the start of a step", "default": true }, "paths": { "$ref": "#/definitions/artifact_list" } }},
can it use the anyOf construct?
"complex_artifacts": { "type": "object", "properties": { "anyOf": [ {"download": { "type": "boolean", "description": "Enables downloading of all available artifacts at the start of a step", "default": true }}, {"paths": { "$ref": "#/definitions/artifact_list" }} ] }},
Cheers
Chris
Hey @Chris Heale,
Thanks for reaching out.
complex_artifacts doesn't actually require both download and path since there's no required directive. It should work fine with one or both properties (and also with no properties at all, which in fact is invalid in Pipelines, but schema isn't 100% accurate).
Check out the screencast: the step is highlighted when it doesn't match the schema (highlighting isn't very accurate, but that's a limitation of the validation engine used).
Let me know which validation mechanism you use if it doesn't work for you.
It looks like you're new here. Sign in or register to get started.