From 7c8817837a7b899e5421b69943018a9fefeae497 Mon Sep 17 00:00:00 2001 From: MilenaHristova Date: Wed, 1 Feb 2023 15:36:42 +0100 Subject: [PATCH] nested if --- .vsts-ci.yml | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/.vsts-ci.yml b/.vsts-ci.yml index 5940eaddb..fc4f4c8bb 100644 --- a/.vsts-ci.yml +++ b/.vsts-ci.yml @@ -372,23 +372,25 @@ stages: - template: /eng/common/templates/jobs/source-build.yml -# You can temporarily disable the VMR Build stage by setting the disableVmrBuild variable on the installer pipeline -- ${{ if and(eq(variables['Build.Reason'], 'PullRequest'), not(parameters.disableVmrBuild)) }}: - - template: eng/pipelines/templates/stages/vmr-build.yml - parameters: - vmrBranch: ${{ variables.VmrBranch }} - isBuiltFromVmr: false +- ${{ if eq(variables['Build.Reason'], 'PullRequest') }}: -# In case the VMR Build stage is temporarily disabled, the VMR synchronization step is run to validate -# that the PR can be merged and later synchronized into the VMR without problems. -- ${{ if and(eq(variables['Build.Reason'], 'PullRequest'), parameters.disableVmrBuild) }}: - - stage: Synchronize_VMR - displayName: Synchronize VMR - dependsOn: [] - jobs: - - template: eng/pipelines/templates/jobs/vmr-synchronization.yml + # You can temporarily disable the VMR Build stage by setting the disableVmrBuild variable on the installer pipeline + - ${{ if not(parameters.disableVmrBuild) }}: + - template: eng/pipelines/templates/stages/vmr-build.yml parameters: vmrBranch: ${{ variables.VmrBranch }} + isBuiltFromVmr: false + + # In case the VMR Build stage is temporarily disabled, the VMR synchronization step is run to validate + # that the PR can be merged and later synchronized into the VMR without problems. + - ${{ else }}: + - stage: Synchronize_VMR + displayName: Synchronize VMR + dependsOn: [] + jobs: + - template: eng/pipelines/templates/jobs/vmr-synchronization.yml + parameters: + vmrBranch: ${{ variables.VmrBranch }} - ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: - stage: Publish