I have three environments: dev, hml and qa.
In my pipeline depending on the branch the stage has a condition to check whether it will run or not:
- stage: Project_Deploy_DEV
condition: eq(variables['Build.SourceBranch'], 'refs/heads/dev')
dependsOn: Project_Build
- stage: Project_Deploy_HML
condition: eq(variables['Build.SourceBranch'], 'refs/heads/hml')
dependsOn: Project_Build
I'm doing the qa stage, and I'd like to put a condition, depending on the branch, the dependson parameter will change:
- stage: Project_QA
condition:
${{ if eq(variables['Build.SourceBranchName'], 'dev') }}:
dependsOn: 'Project_Deploy_DEV'
${{ if eq(variables['Build.SourceBranchName'], 'hml') }}:
dependsOn: 'Project_Deploy_HML'
However, the condition above is not working, would anyone know the best way to perform this condition?
Thanks