Skip to content

Commit c4dc560

Browse files
authored
Exclude runtime-dependent jobs on non-1xx branches (#1897)
1 parent 423c9a6 commit c4dc560

File tree

3 files changed

+333
-290
lines changed

3 files changed

+333
-290
lines changed

eng/pipelines/templates/stages/vmr-build.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,15 @@ parameters:
9090
demands: ImageOverride -equals $(poolImage_Linux)
9191
os: linux
9292

93+
- name: featureBand
94+
displayName: 'Target Feature Band'
95+
type: string
96+
default: 'Detect by Branch Name'
97+
values:
98+
- 'Detect by Branch Name'
99+
- '1xx'
100+
- '>= 2xx'
101+
93102
stages:
94103
- template: vmr-verticals.yml
95104
parameters:
@@ -100,6 +109,12 @@ stages:
100109
isBuiltFromVmr: ${{ parameters.isBuiltFromVmr }}
101110
scope: ${{ parameters.scope }}
102111
verifications: ${{ parameters.verifications }}
112+
# Exclude runtime dependent jobs for any branch not producing a 1xx version since runtime-related repos aren't built in that context
113+
# Will exclude runtime-dependent jobs when either of the following are true:
114+
# - 'Detect By Branch Name' was selected for the feature band: branch is not main and does not contain '.1xx' but does end with 'xx'.
115+
# - '>= 2xx' was selected for the feature band
116+
${{ if or(and(eq(parameters.featureBand, 'Detect by Branch Name'), ne(variables['Build.SourceBranch'], 'refs/heads/main'), not(contains(variables['Build.SourceBranch'], '.1xx')), endsWith(variables['Build.SourceBranch'], 'xx')), eq(parameters.featureBand, '>= 2xx')) }}:
117+
excludeRuntimeDependentJobs: true
103118

104119
- ${{ if and(parameters.isBuiltFromVmr, eq(parameters.isOfficialBuild, true)) }}:
105120
- stage: Publish_Build_Assets

0 commit comments

Comments
 (0)