Skip to content

Commit f9dc2bb

Browse files
authored
Fix OneLocBuild conditional logic and naming (#5364)
1 parent de346c8 commit f9dc2bb

File tree

2 files changed

+19
-11
lines changed

2 files changed

+19
-11
lines changed

azure-pipelines.yml

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,24 @@ stages:
4141
displayName: Build
4242
jobs:
4343
- ${{ if and( ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
44-
- template: /eng/common/templates/job/onelocbuild.yml
45-
parameters:
46-
MirrorRepo: templating
47-
LclSource: lclFilesfromPackage
48-
${{ if eq(variables['Build.SourceBranch'], format('{0}{1}', 'refs/heads/', variables['OneLocBuildBranch'])) }}:
49-
MirrorBranch: $(OneLocBuildBranch)
44+
- ${{ if startsWith(variables['Build.SourceBranch'], 'refs/heads/release/') }}:
45+
- template: /eng/common/templates/job/onelocbuild.yml
46+
parameters:
47+
MirrorRepo: templating
48+
LclSource: lclFilesfromPackage
5049
LclPackageId: 'LCL-JUNO-PROD-TEMPLATING'
51-
${{ if eq(variables['Build.SourceBranch'], 'refs/heads/main') }}:
52-
MirrorBranch: 'main'
50+
MirrorBranch: $(OneLocBuildBranch)
51+
JobNameSuffix: '_release'
52+
condition: eq(variables['Build.SourceBranch'], format('{0}{1}', 'refs/heads/', variables['OneLocBuildBranch'] ))
53+
- ${{ if eq(variables['Build.SourceBranch'], 'refs/heads/main') }}:
54+
- template: /eng/common/templates/job/onelocbuild.yml
55+
parameters:
56+
MirrorRepo: templating
57+
LclSource: lclFilesfromPackage
5358
LclPackageId: 'LCL-JUNO-PROD-TMPLTNGMAIN'
54-
condition: eq(or(variables['Build.SourceBranch'], format('{0}{1}', 'refs/heads/', variables['OneLocBuildBranch'] )), eq(variables['Build.SourceBranch'], 'refs/heads/main'))
59+
MirrorBranch: 'main'
60+
JobNameSuffix: '_main'
61+
condition: eq(variables['Build.SourceBranch'], 'refs/heads/main')
5562
- template: /eng/common/templates/jobs/jobs.yml
5663
parameters:
5764
enableMicrobuild: true

eng/common/templates/job/onelocbuild.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,14 @@ parameters:
2222
MirrorRepo: ''
2323
MirrorBranch: main
2424
condition: ''
25+
JobNameSuffix: ''
2526

2627
jobs:
27-
- job: OneLocBuild
28+
- job: OneLocBuild${{ parameters.JobNameSuffix }}
2829

2930
dependsOn: ${{ parameters.dependsOn }}
3031

31-
displayName: OneLocBuild
32+
displayName: OneLocBuild${{ parameters.JobNameSuffix }}
3233

3334
${{ if ne(parameters.pool, '') }}:
3435
pool: ${{ parameters.pool }}

0 commit comments

Comments
 (0)