I have an Azure multi-stage CI/CD pipeline. It has stages for Test and UAT deployment.
I want the UAT release to run if Test succeeds or is skipped, but not if it fails.
I can't. Whatever I try, if Test is skipped, UAT is also skipped. Unless I use always()
, but then UAT will run even if Test fails.
...
- stage: Test
condition: and(succeeded(), ne(variables['build.sourceBranchName'], 'DoUAT')) # Skip for UAT deployment tests
...
- stage: UAT
condition: and(succeeded(), in(variables['build.sourceBranchName'], 'master', 'DoUAT')) # Only deploy off master branch and branch to test UAT deploys.
...
How do I skip one stage but not the next one?