We have several stages consisting of one or more steps. We would like ability to define if a stage should be executed based on condition declared as workspace or repository variable.
Looked at the schema but condition does not let us use variables as intended. https://bitbucket.org/atlassianlabs/intellij-bitbucket-references-plugin/raw/master/src/main/resources/schemas/bitbucket-pipelines.schema.json
pipelines:
default:
- stage:
name: Deploy to QA
deployment: qa
condition: ${QA_STAGE_ENABLED} == "true"
trigger: manual
steps:
- step:
condition: ${QA_STAGE_ENABLED} == "true" is what is being recommended. At the moment the only way to skip a stage is to comment it out in bitbucket-pipelines.yaml file which is not the most pleasant experience.