Skip to content

Commit e39c438

Browse files
authored
Migrate VMR-related pipelines to 1ES templates (#19100)
1 parent 0d5c4d5 commit e39c438

File tree

12 files changed

+264
-310
lines changed

12 files changed

+264
-310
lines changed

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

Lines changed: 29 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ jobs:
101101
condition: succeededOrFailed()
102102
dependsOn: ${{ parameters.reuseBuildArtifactsFrom }}_${{ parameters.architecture }}
103103
variables:
104-
- template: /eng/common/templates/variables/pool-providers.yml
105104
- ${{ if eq(variables['System.TeamProject'], 'internal') }}:
106105
- group: AzureDevOps-Artifact-Feeds-Pats
107106
- ${{ if and(not(parameters.isBuiltFromVmr), eq(variables['System.TeamProject'], 'internal'), not(startswith(parameters.vmrBranch, 'internal/release/')), not(eq(variables['Build.Reason'], 'PullRequest'))) }}:
@@ -128,9 +127,36 @@ jobs:
128127
- name: sourcesPath
129128
value: $(vmrPath)
130129

130+
templateContext:
131+
outputs:
132+
- output: pipelineArtifact
133+
displayName: Publish BuildLogs
134+
condition: succeededOrFailed()
135+
targetPath: $(Build.StagingDirectory)/BuildLogs
136+
artifactName: $(Agent.JobName)_BuildLogs_Attempt$(System.JobAttempt)
137+
138+
- output: pipelineArtifact
139+
displayName: Publish Artifacts
140+
condition: and(succeededOrFailed(), eq(variables['hasAssets'], 'true'))
141+
targetPath: $(sourcesPath)/artifacts/assets/Release/
142+
artifactName: $(Agent.JobName)_Artifacts
143+
144+
- ${{ if ne(parameters.buildSourceOnly, 'true') }}:
145+
- output: pipelineArtifact
146+
displayName: Publish Packages
147+
targetPath: $(sourcesPath)/artifacts/packages/Release/
148+
artifactName: $(Agent.JobName)_Packages
149+
150+
- ${{ if not(parameters.isBuiltFromVmr) }}:
151+
- output: pipelineArtifact
152+
displayName: Upload failed patches
153+
condition: failed()
154+
targetPath: $(Agent.TempDirectory)
155+
artifactName: $(System.JobDisplayName)_FailedPatches
156+
131157
steps:
132158
- ${{ if not(parameters.isBuiltFromVmr) }}:
133-
- template: ../steps/vmr-prepare.yml
159+
- template: ../steps/vmr-prepare.yml@self
134160
parameters:
135161
${{ if eq(variables['Build.Reason'], 'PullRequest') }}:
136162
vmrBranch: $(System.PullRequest.TargetBranch)
@@ -139,7 +165,7 @@ jobs:
139165

140166
# Synchronize new content in the VMR during PRs (we expect this to come
141167
- ${{ if eq(variables['Build.Reason'], 'PullRequest') }}:
142-
- template: ../steps/vmr-pull-updates.yml
168+
- template: ../steps/vmr-pull-updates.yml@self
143169
parameters:
144170
vmrPath: $(vmrPath)
145171
vmrBranch: ${{ parameters.vmrBranch }}
@@ -402,12 +428,6 @@ jobs:
402428
continueOnError: true
403429
condition: succeededOrFailed()
404430
405-
- publish: '$(Build.StagingDirectory)/BuildLogs'
406-
artifact: $(Agent.JobName)_BuildLogs_Attempt$(System.JobAttempt)
407-
displayName: Publish BuildLogs
408-
continueOnError: true
409-
condition: succeededOrFailed()
410-
411431
# Only upload test results if enabled
412432
- ${{ if eq(parameters.runTests, 'True') }}:
413433
- task: PublishTestResults@2
@@ -421,15 +441,3 @@ jobs:
421441
mergeTestResults: true
422442
publishRunAttachments: true
423443
testRunTitle: SourceBuild_SmokeTests_$(Agent.JobName)
424-
425-
- publish: '$(sourcesPath)/artifacts/assets/Release/'
426-
artifact: $(Agent.JobName)_Artifacts
427-
displayName: Publish Artifacts
428-
condition: and(succeededOrFailed(), eq(variables['hasAssets'], 'true'))
429-
continueOnError: true
430-
431-
# When building from source, the Private.SourceBuilt.Artifacts archive already contains the nuget packages
432-
- ${{ if ne(parameters.buildSourceOnly, 'true') }}:
433-
- publish: '$(sourcesPath)/artifacts/packages/Release/'
434-
artifact: $(Agent.JobName)_Packages
435-
displayName: Publish Packages

eng/pipelines/templates/jobs/vmr-synchronization.yml

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@ jobs:
2222
displayName: Synchronize VMR's ${{ parameters.vmrBranch }}
2323
timeoutInMinutes: 120
2424
variables:
25-
- template: /eng/common/templates/variables/pool-providers.yml
25+
- ${{ if eq(variables['System.TeamProject'], 'public') }}:
26+
- template: /eng/common/templates/variables/pool-providers.yml
27+
- ${{ else }}:
28+
- template: /eng/common/templates-official/variables/pool-providers.yml
2629
- name: vmrPath
2730
value: $(Agent.BuildDirectory)/vmr
2831
- ${{ if not(parameters.noPush) }}:
@@ -40,23 +43,17 @@ jobs:
4043
pool:
4144
${{ if eq(variables['System.TeamProject'], 'public') }}:
4245
name: $(DncEngPublicBuildPool)
43-
demands: ImageOverride -equals Build.Ubuntu.2004.Amd64.Open
44-
${{ if eq(variables['System.TeamProject'], 'internal') }}:
46+
image: 1es-ubuntu-2004-open
47+
os: linux
48+
${{ else }}:
4549
name: $(DncEngInternalBuildPool)
46-
demands: ImageOverride -equals Build.Ubuntu.2004.Amd64
50+
demands: ImageOverride -equals 1es-ubuntu-2004
51+
os: linux
4752

4853
steps:
4954
- template: ../steps/vmr-prepare.yml
5055
parameters:
5156
vmrBranch: ${{ parameters.vmrBranch }}
52-
53-
# TODO (https://github.com/dotnet/arcade/issues/11332): Allow full CG?
54-
# Currently, we ignore dirs of individual repos - they have been scanned before
55-
- ${{ if and(ne(variables['Build.Reason'], 'PullRequest'), eq(variables['System.TeamProject'], 'internal')) }}:
56-
- task: ComponentGovernanceComponentDetection@0
57-
inputs:
58-
sourceScanPath: $(Agent.BuildDirectory)/vmr
59-
ignoreDirectories: $(Agent.BuildDirectory)/vmr/src
6057

6158
- template: ../steps/vmr-pull-updates.yml
6259
parameters:

0 commit comments

Comments
 (0)