I have multiple pipelines that are being built from a multistage yaml (extends: template:) and i want to set conditions on which jobs and steps should run when i pass a variable. So in this case i want to set the variable 'Migrations=false' and skip some jobs (Migration job) and some steps (npm run integration-tests) on my integration Job
I have tried to use (to skip migration jobs on migration.yaml)
stages:
- stage: dev
displayName: dev
jobs:
- ${{if ne(variables.migrations, 'false')}}:
- template: /Dotnet/Release/migration.yaml
and also (to skip integration script on integration.yaml)
jobs:
- template: /Dotnet/Release/integration.yaml
parameters:
migrations: ${{ variables.Migrations }}
###integration.yaml###
- name: 'migrations'
default: 'true'
type: string
jobs:
- job: Integration
steps:
- script: "echo step1"
- ${{if ne(parameters.migrations, 'false')}}:
- script: npm run integration-tests