Add pipeline parameter for disabling the VMR build during PRs (#15328)

This commit is contained in:
Přemek Vysoký 2023-01-23 17:20:17 +01:00 committed by GitHub
parent 779a6442da
commit e22e2fba2e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -23,6 +23,11 @@ parameters:
type: string
default: $(Build.SourceBranchName)
- name: disableVmrBuild
displayName: Skip source-building the VMR
type: boolean
default: false
variables:
- name: _PublishUsingPipelines
value: false
@ -360,7 +365,16 @@ stages:
- template: /eng/common/templates/jobs/source-build.yml
- ${{ if and(eq(variables['System.TeamProject'], 'internal'), ne(variables['Build.Reason'], 'PullRequest')) }}:
# 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: ${{ parameters.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: []
@ -369,16 +383,6 @@ stages:
parameters:
vmrBranch: ${{ parameters.vmrBranch }}
# In case the VMR Build stage needs to be temporarily disabled, please make sure that
# the VMR synchronization step is run to validate that the PR can be merged and later
# synchronized into the VMR without problems.
# You can do this by allowing the Synchronize_VMR stage from above in PRs.
- ${{ if eq(variables['Build.Reason'], 'PullRequest') }}:
- template: eng/pipelines/templates/stages/vmr-build.yml
parameters:
vmrBranch: ${{ parameters.vmrBranch }}
isBuiltFromVmr: false
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
- stage: Publish
dependsOn: