Skip to content

Commit 8b745e8

Browse files
v-wuzhaidsplaistedmmitche
authored
[release/6.0.1xx] Migrate to 1ES templates for internal builds (#39838)
Co-authored-by: Daniel Plaisted <[email protected]> Co-authored-by: Matt Mitchell (.NET) <[email protected]>
1 parent 9cc9d52 commit 8b745e8

File tree

4 files changed

+410
-172
lines changed

4 files changed

+410
-172
lines changed

.vsts-ci.yml

Lines changed: 185 additions & 153 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,9 @@ pr:
1313
- release/*
1414
- internal/release/*
1515

16-
1716
variables:
18-
- name: teamName
19-
value: Roslyn-Project-System
20-
- name: _DotNetPublishToBlobFeed
21-
value: false
2217
- name: _CIBuild
2318
value: -restore -build -sign -pack -ci
24-
- name: _DotNetArtifactsCategory
25-
value: .NETCore
26-
- name: _DotNetValidationArtifactsCategory
27-
value: .NETCore
2819
- name: PostBuildSign
2920
value: true
3021
- ${{ if eq(variables['System.TeamProject'], 'public') }}:
@@ -41,158 +32,199 @@ variables:
4132
/p:DotNetRuntimeSourceFeedKey=$(dotnetbuilds-internal-container-read-token-base64)
4233
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
4334
- group: DotNet-CLI-SDLValidation-Params
35+
# Set the MicroBuild plugin installation directory to the agent temp directory to avoid SDL tool scanning.
36+
- name: MicroBuildOutputFolderOverride
37+
value: $(Agent.TempDirectory)
38+
39+
resources:
40+
repositories:
41+
- repository: 1esPipelines
42+
type: git
43+
name: 1ESPipelineTemplates/1ESPipelineTemplates
44+
ref: refs/tags/release
4445

45-
stages:
46-
- stage: build
47-
displayName: Build
48-
jobs:
49-
- job: Publish_Build_Configuration
50-
pool:
51-
${{ if eq(variables['System.TeamProject'], 'public') }}:
52-
name: NetCore-Svc-Public
53-
demands: ImageOverride -equals windows.vs2019.amd64.open
54-
${{ if eq(variables['System.TeamProject'], 'internal') }}:
46+
extends:
47+
template: v1/1ES.Official.PipelineTemplate.yml@1esPipelines
48+
parameters:
49+
sdl:
50+
sourceAnalysisPool:
5551
name: NetCore1ESPool-Svc-Internal
56-
demands: ImageOverride -equals windows.vs2019.amd64
57-
steps:
58-
- publish: $(Build.SourcesDirectory)\eng\BuildConfiguration
59-
artifact: BuildConfiguration
60-
displayName: Publish Build Config
61-
- template: /eng/build.yml
62-
parameters:
63-
agentOs: Windows_NT
64-
pool:
65-
${{ if eq(variables['System.TeamProject'], 'public') }}:
66-
name: NetCore-Svc-Public
67-
demands: ImageOverride -equals windows.vs2022preview.amd64.open
68-
${{ if ne(variables['System.TeamProject'], 'public') }}:
69-
name: NetCore1ESPool-Svc-Internal
70-
demands: ImageOverride -equals windows.vs2022preview.amd64
71-
${{ if eq(variables['System.TeamProject'], 'public') }}:
72-
helixTargetQueue: Windows.Amd64.VS2022.Pre.Open
73-
${{ if ne(variables['System.TeamProject'], 'public') }}:
74-
helixTargetQueue: Windows.Amd64.VS2022.Pre
75-
strategy:
76-
matrix:
77-
Build_Release:
78-
_BuildConfig: Release
79-
_PublishArgs: '-publish /p:DotNetPublishUsingPipelines=true'
80-
${{ if or(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest')) }}:
81-
_SignType: test
82-
_Test: -test
83-
${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
84-
_SignType: real
85-
_Test: ''
86-
- template: /eng/common/templates/job/source-build.yml
87-
parameters:
88-
platform:
89-
name: 'Managed'
90-
container: 'mcr.microsoft.com/dotnet-buildtools/prereqs:centos-7-3e800f1-20190501005343'
91-
- ${{ if or(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest')) }}:
92-
- template: /eng/build.yml
93-
parameters:
94-
agentOs: Windows_NT_FullFramework
52+
image: 1es-windows-2022
53+
os: windows
54+
stages:
55+
- stage: build
56+
displayName: Build
57+
jobs:
58+
- job: Publish_Build_Configuration
9559
pool:
9660
${{ if eq(variables['System.TeamProject'], 'public') }}:
9761
name: NetCore-Svc-Public
98-
demands: ImageOverride -equals windows.vs2022preview.amd64.open
99-
${{ if ne(variables['System.TeamProject'], 'public') }}:
62+
image: 1es-windows-2019-open
63+
os: windows
64+
${{ if eq(variables['System.TeamProject'], 'internal') }}:
10065
name: NetCore1ESPool-Svc-Internal
101-
demands: ImageOverride -equals windows.vs2022preview.amd64
102-
${{ if eq(variables['System.TeamProject'], 'public') }}:
103-
helixTargetQueue: Windows.Amd64.VS2022.Pre.Open
104-
${{ if ne(variables['System.TeamProject'], 'public') }}:
105-
helixTargetQueue: Windows.Amd64.VS2022.Pre
106-
strategy:
107-
matrix:
108-
Build_Debug:
109-
_BuildConfig: Debug
110-
_PublishArgs: ''
111-
_SignType: test
112-
_Test: -test
113-
114-
- template: /eng/build.yml
115-
parameters:
116-
agentOs: Windows_NT_TestAsTools
117-
pool:
66+
image: 1es-windows-2019
67+
os: windows
68+
steps:
69+
- task: 1ES.PublishPipelineArtifact@1
70+
displayName: Publish Build Config
71+
inputs:
72+
targetPath: $(Build.SourcesDirectory)\eng\buildConfiguration
73+
artifactName: buildConfiguration
74+
- template: /eng/build.yml@self
75+
parameters:
76+
agentOs: Windows_NT
77+
pool:
78+
${{ if eq(variables['System.TeamProject'], 'public') }}:
79+
name: NetCore-Svc-Public
80+
image: 1es-windows-2022-open
81+
os: windows
82+
${{ if ne(variables['System.TeamProject'], 'public') }}:
83+
name: NetCore1ESPool-Svc-Internal
84+
image: 1es-windows-2022
85+
os: windows
11886
${{ if eq(variables['System.TeamProject'], 'public') }}:
119-
name: NetCore-Svc-Public
120-
demands: ImageOverride -equals windows.vs2019.amd64.open
87+
helixTargetQueue: Windows.Amd64.VS2022.Pre.Open
12188
${{ if ne(variables['System.TeamProject'], 'public') }}:
122-
name: NetCore1ESPool-Svc-Internal
123-
demands: ImageOverride -equals windows.vs2019.amd64
124-
strategy:
125-
matrix:
126-
Build_Debug:
127-
_BuildConfig: Debug
128-
_PublishArgs: ''
129-
_SignType: test
89+
helixTargetQueue: Windows.Amd64.VS2022.Pre
90+
variables:
91+
- name: _BuildConfig
92+
value: Release
93+
- name: _PublishArgs
94+
value: '-publish /p:DotNetPublishUsingPipelines=true'
95+
- ${{ if or(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest')) }}:
96+
- name: _SignType
97+
value: test
98+
- name: _Test
99+
value: -test
100+
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
101+
- name: _SignType
102+
value: real
103+
- name: _Test
104+
value: ''
105+
- template: /eng/common/templates-official/job/source-build.yml@self
106+
parameters:
107+
platform:
108+
name: 'Managed'
109+
container: 'mcr.microsoft.com/dotnet-buildtools/prereqs:centos-7-3e800f1-20190501005343'
110+
- ${{ if or(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest')) }}:
111+
- template: /eng/build.yml@self
112+
parameters:
113+
agentOs: Windows_NT_FullFramework
114+
pool:
115+
${{ if eq(variables['System.TeamProject'], 'public') }}:
116+
name: NetCore-Svc-Public
117+
image: 1es-windows-2022-open
118+
os: windows
119+
${{ if ne(variables['System.TeamProject'], 'public') }}:
120+
name: NetCore1ESPool-Svc-Internal
121+
image: 1es-windows-2022
122+
os: windows
123+
${{ if eq(variables['System.TeamProject'], 'public') }}:
124+
helixTargetQueue: Windows.Amd64.VS2022.Pre.Open
125+
${{ if ne(variables['System.TeamProject'], 'public') }}:
126+
helixTargetQueue: Windows.Amd64.VS2022.Pre
127+
variables:
128+
- name: _BuildConfig
129+
value: Debug
130+
- name: _PublishArgs
131+
value: ''
132+
- name: _SignType
133+
value: test
134+
- name: _Test
135+
value: -test
130136

131-
- template: /eng/build.yml
132-
parameters:
133-
agentOs: Ubuntu_20_04
134-
pool:
135-
${{ if eq(variables['System.TeamProject'], 'public') }}:
136-
name: NetCore-Svc-Public
137-
demands: ImageOverride -equals Build.Ubuntu.2004.Amd64.Open
138-
${{ if ne(variables['System.TeamProject'], 'public') }}:
139-
name: NetCore1ESPool-Svc-Internal
140-
demands: ImageOverride -equals Build.Ubuntu.2004.Amd64
141-
${{ if eq(variables['System.TeamProject'], 'public') }}:
142-
helixTargetQueue: Ubuntu.1804.Amd64.Open
143-
${{ if ne(variables['System.TeamProject'], 'public') }}:
144-
helixTargetQueue: Ubuntu.1804.Amd64
145-
strategy:
146-
matrix:
147-
Build_Release:
148-
_BuildConfig: Release
149-
_PublishArgs: ''
150-
_SignType: test
137+
- template: /eng/build.yml@self
138+
parameters:
139+
agentOs: Windows_NT_TestAsTools
140+
pool:
141+
${{ if eq(variables['System.TeamProject'], 'public') }}:
142+
name: NetCore-Svc-Public
143+
image: 1es-windows-2019-open
144+
os: windows
145+
${{ if ne(variables['System.TeamProject'], 'public') }}:
146+
name: NetCore1ESPool-Svc-Internal
147+
image: 1es-windows-2019
148+
os: windows
149+
variables:
150+
- name: _BuildConfig
151+
value: Debug
152+
- name: _PublishArgs
153+
value: ''
154+
- name: _SignType
155+
value: test
151156

152-
- template: /eng/build.yml
153-
parameters:
154-
agentOs: Darwin
155-
pool:
156-
vmImage: 'macOS-latest'
157-
${{ if eq(variables['System.TeamProject'], 'public') }}:
158-
helixTargetQueue: OSX.1200.Amd64.Open
159-
${{ if ne(variables['System.TeamProject'], 'public') }}:
160-
helixTargetQueue: OSX.1200.Amd64
161-
strategy:
162-
matrix:
163-
Build_Release:
164-
_BuildConfig: Release
165-
_PublishArgs: ''
166-
_SignType: test
157+
- template: /eng/build.yml@self
158+
parameters:
159+
agentOs: Ubuntu_20_04
160+
pool:
161+
${{ if eq(variables['System.TeamProject'], 'public') }}:
162+
name: NetCore-Svc-Public
163+
image: 1es-ubuntu-2004-open
164+
os: linux
165+
${{ if ne(variables['System.TeamProject'], 'public') }}:
166+
name: NetCore1ESPool-Svc-Internal
167+
image: 1es-ubuntu-2004
168+
os: linux
169+
${{ if eq(variables['System.TeamProject'], 'public') }}:
170+
helixTargetQueue: Ubuntu.1804.Amd64.Open
171+
${{ if ne(variables['System.TeamProject'], 'public') }}:
172+
helixTargetQueue: Ubuntu.1804.Amd64
173+
variables:
174+
- name: _BuildConfig
175+
value: Release
176+
- name: _PublishArgs
177+
value: ''
178+
- name: _SignType
167179

168-
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
169-
- template: /eng/common/templates/job/publish-build-assets.yml
170-
parameters:
171-
publishUsingPipelines: true
172-
dependsOn:
173-
- Windows_NT
174-
- Source_Build_Managed
175-
pool:
176-
name: NetCore1ESPool-Svc-Internal
177-
demands: ImageOverride -equals windows.vs2019.amd64
178-
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
179-
- template: /eng/common/templates/post-build/post-build.yml
180-
parameters:
181-
publishingInfraVersion: 3
182-
enableSymbolValidation: false
183-
enableSigningValidation: false
184-
enableNugetValidation: false
185-
enableSourceLinkValidation: false
186-
publishInstallersAndChecksums: true
187-
SDLValidationParameters:
188-
enable: false
189-
params: ' -SourceToolsList @("policheck","credscan")
190-
-TsaInstanceURL $(_TsaInstanceURL)
191-
-TsaProjectName $(_TsaProjectName)
192-
-TsaNotificationEmail $(_TsaNotificationEmail)
193-
-TsaCodebaseAdmin $(_TsaCodebaseAdmin)
194-
-TsaBugAreaPath $(_TsaBugAreaPath)
195-
-TsaIterationPath $(_TsaIterationPath)
196-
-TsaRepositoryName "dotnet-sdk"
197-
-TsaCodebaseName "dotnet-sdk"
198-
-TsaPublish $True'
180+
- template: /eng/build.yml@self
181+
parameters:
182+
agentOs: Darwin
183+
pool:
184+
name: Azure Pipelines
185+
image: macOS-latest
186+
os: macOS
187+
${{ if eq(variables['System.TeamProject'], 'public') }}:
188+
helixTargetQueue: OSX.1200.Amd64.Open
189+
${{ if ne(variables['System.TeamProject'], 'public') }}:
190+
helixTargetQueue: OSX.1200.Amd64
191+
variables:
192+
- name: _BuildConfig
193+
value: Release
194+
- name: _PublishArgs
195+
value: ''
196+
- name: _SignType
197+
value: test
198+
199+
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
200+
- template: /eng/common/templates-official/job/publish-build-assets.yml@self
201+
parameters:
202+
publishUsingPipelines: true
203+
dependsOn:
204+
- Windows_NT
205+
- Source_Build_Managed
206+
pool:
207+
name: NetCore1ESPool-Svc-Internal
208+
image: 1es-windows-2019
209+
os: windows
210+
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
211+
- template: /eng/common/templates-official/post-build/post-build.yml@self
212+
parameters:
213+
publishingInfraVersion: 3
214+
enableSymbolValidation: false
215+
enableSigningValidation: false
216+
enableNugetValidation: false
217+
enableSourceLinkValidation: false
218+
publishInstallersAndChecksums: true
219+
SDLValidationParameters:
220+
enable: false
221+
params: ' -SourceToolsList @("policheck","credscan")
222+
-TsaInstanceURL $(_TsaInstanceURL)
223+
-TsaProjectName $(_TsaProjectName)
224+
-TsaNotificationEmail $(_TsaNotificationEmail)
225+
-TsaCodebaseAdmin $(_TsaCodebaseAdmin)
226+
-TsaBugAreaPath $(_TsaBugAreaPath)
227+
-TsaIterationPath $(_TsaIterationPath)
228+
-TsaRepositoryName "dotnet-sdk"
229+
-TsaCodebaseName "dotnet-sdk"
230+
-TsaPublish $True'

0 commit comments

Comments
 (0)