1+ # This Yaml Document has been converted by ESAI Yaml Pipeline Conversion Tool.
2+ # This pipeline will be extended to the OneESPT template
3+
4+ trigger : none
5+
6+ resources :
7+ repositories :
8+ - repository : 1ESPipelineTemplates
9+ type : git
10+ name : 1ESPipelineTemplates/1ESPipelineTemplates
11+ ref : refs/tags/release
12+
13+ parameters :
14+ - name : task_deployment
15+ displayName : Choose deployment options
16+ type : string
17+ default : ' Deploy task of Sprint'
18+ values :
19+ - ' Deploy all Tasks'
20+ - ' Deploy task of Sprint'
21+ - ' Deploy Hotfix'
22+ - name : task_name
23+ displayName : |
24+ To 'Deploy Hotfix' provide task names (e.g. BashV3,AzureCLIV1,PowerShellV2) else leave to default
25+ type : string
26+ default : ' TaskNameVN'
27+ - name : enableCodeQL
28+ displayName : Enable CodeQL for run
29+ type : boolean
30+ default : false
31+ - name : includeLocalPackagesBuildConfig
32+ displayName : Flag to update LocalPackages buildconfig (for testing, this will be made default later)
33+ type : boolean
34+ default : false # note: keep in sync with ci\ci-test-tasks\canary-tests-v2.yml
35+ - name : skip_publish
36+ displayName : skipPublish (Not for production use)
37+ type : boolean
38+ default : false
39+ - name : publishToDistributedTaskTest
40+ displayName : Publish to test feed (DistributedTasks-test), for infrastucture testing
41+ type : boolean
42+ default : false
43+ - name : dryRun
44+ displayName : Dry Run (no push, no PR, no feed publish)
45+ type : boolean
46+ default : false
47+
48+ variables :
49+ - name : currentDate
50+ value : $[ format('{0:yyyy}{0:MM}{0:dd}', pipeline.startTime) ]
51+ - name : taskName
52+ value : ${{ parameters.task_name }}
53+ - name : taskNameIsSet
54+ value : ${{ not(or(eq(parameters.task_deployment, 'Deploy all Tasks'), eq(parameters.task_deployment, 'Deploy task of Sprint'))) }}
55+ - name : runCodeQl
56+ value : ${{ eq(parameters.enableCodeQL, true) }}
57+ - name : system.debug
58+ value : true
59+ - name : includeLocalPackagesBuildConfigParameter
60+ ${{ if eq(parameters.includeLocalPackagesBuildConfig, true) }} :
61+ value : ' --includeLocalPackagesBuildConfig'
62+ ${{ else }} :
63+ value : ' '
64+ - name : IncludeLocalPackagesBuildConfigTest
65+ ${{ if eq(parameters.includeLocalPackagesBuildConfig, true) }} :
66+ value : ' 1'
67+ ${{ else }} :
68+ value : ' '
69+ - name : tasksSkipPublish
70+ ${{ if eq(parameters.skip_publish, true) }} :
71+ value : ' true'
72+ ${{ else }} :
73+ value : ' false'
74+ - name : DEPLOY_ALL_TASKSVAR
75+ ${{ if eq(parameters.task_deployment,'Deploy all Tasks') }} :
76+ value : ' true'
77+ ${{ else }} :
78+ value : ' false'
79+ - name : isDryRun
80+ ${{ if eq(parameters.dryRun, true) }} :
81+ value : ' true'
82+ ${{ else }} :
83+ value : ' false'
84+
85+ extends :
86+ template : v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates
87+ parameters :
88+ settings :
89+ skipBuildTagsForGitHubPullRequests : true
90+ featureFlags :
91+ autoBaseline : false
92+ sdl :
93+ sbom :
94+ enabled : true
95+ baseline :
96+ baselineSet : default
97+ baselineFile : $(Build.SourcesDirectory)/.gdn/.gdnbaselines
98+ sourceAnalysisPool :
99+ name : 1ES-ABTT-Shared-Pool
100+ image : abtt-windows-2022
101+ os : windows
102+ sourceRepositoriesToScan :
103+ exclude :
104+ - repository : AzureDevOps
105+ - repository : ConfigChange
106+ customBuildTags :
107+ - ES365AIMigrationTooling
108+ stages :
109+ - stage : main
110+ jobs :
111+ # All tasks on Windows
112+ - job : build_all_windows
113+ displayName : Build all tasks (Windows)
114+ condition : eq(variables.os, 'Windows_NT')
115+ timeoutInMinutes : 1440 # AntiMalware takes 3 hours to scan tasks.zip
116+ pool :
117+ name : 1ES-ABTT-Shared-Pool
118+ image : abtt-windows-2022
119+ os : windows
120+ templateContext :
121+ outputs :
122+ - output : buildArtifacts
123+ displayName : ' Publish package artifact'
124+ condition : >
125+ and(
126+ succeeded(),
127+ ne(variables['build.reason'], 'PullRequest'),
128+ ne(variables['numTasks'], 0)
129+ )
130+ PathtoPublish : _package/tasks.zip
131+ ArtifactName : package
132+ sbomBuildDropPath : $(Build.SourcesDirectory)/_package
133+ steps :
134+ - template : /ci/build-all-steps.yml@self
135+ parameters :
136+ os : Windows_NT
137+
138+ # Publish
139+ - job : publish
140+ displayName : Publish Nuget Artifacts
141+ timeoutInMinutes : 360
142+ dependsOn :
143+ - build_all_windows
144+ condition : and(succeeded(), ne(variables['build.reason'], 'PullRequest'), eq(variables['tasksSkipPublish'], 'false'))
145+ pool :
146+ name : 1ES-ABTT-Shared-Pool
147+ image : abtt-windows-2022
148+ os : windows
149+ templateContext :
150+ outputs :
151+ - output : buildArtifacts
152+ displayName : ' Publish per task NuGet package artifact'
153+ PathtoPublish : _package/nuget-packages
154+ ArtifactName : IndividualNuGetPackages
155+ steps :
156+ - template : /ci/publish-steps.yml@self
157+
158+ # Courtesy Push
159+ - job : courtesy_push
160+ displayName : Courtesy Push
161+ timeoutInMinutes : 180
162+ pool :
163+ name : 1ES-ABTT-Shared-Pool
164+ image : abtt-windows-2022
165+ os : windows
166+ dependsOn :
167+ - publish
168+ condition : |
169+ and(
170+ succeeded(),
171+ eq(variables['COURTESY_PUSH'], 'true'),
172+ or(
173+ eq(variables['build.reason'], 'Schedule'),
174+ and(
175+ eq(variables['build.reason'], 'Manual'),
176+ eq(variables['FORCE_COURTESY_PUSH'], 'true')
177+ )
178+ )
179+ )
180+ templateContext :
181+ outputs :
182+ - output : nuget
183+ packagesToPush : ' $(Build.SourcesDirectory)/IndividualNugetPackagesDownloaded/IndividualNugetPackages/*/*.nupkg'
184+ packageParentPath : ' $(Build.SourcesDirectory)'
185+ ${{ if or(eq(parameters.dryRun, true),eq(parameters.publishToDistributedTaskTest, true)) }} :
186+ publishVstsFeed : ' c86767d8-af79-4303-a7e6-21da0ba435e2/9d34d871-8032-4e10-a34a-c7a01e125865'
187+ ${{ else }} :
188+ publishVstsFeed : ' c86767d8-af79-4303-a7e6-21da0ba435e2/e10d0795-57cd-4d7f-904e-5f39703cb096'
189+ nuGetFeedType : internal
190+ displayName : Push Nuget package
191+ allowPackageConflicts : $(COURTESY_PUSH)
192+ steps :
193+ - checkout : self
194+ - template : /ci/courtesy-push.yml@self
195+
196+ - job : build_all_tasks_for_deployments
197+ displayName : Build all tasks for deployments (Windows)
198+ dependsOn :
199+ - courtesy_push
200+ - build_all_windows
201+ condition : succeeded()
202+ timeoutInMinutes : 360
203+ pool :
204+ name : 1ES-ABTT-Shared-Pool
205+ image : abtt-windows-2022
206+ os : windows
207+ variables :
208+ task_pattern : $[dependencies.build_all_windows.outputs['getTaskPattern.task_pattern']]
209+ templateContext :
210+ outputs :
211+ - output : buildArtifacts
212+ displayName : ' Publish package artifact'
213+ PathtoPublish : _package/tasks.zip
214+ sbomBuildDropPath : $(Build.SourcesDirectory)/_package
215+ ArtifactName : allTasks
216+ steps :
217+ - template : /ci/build-all-tasks.yml@self
218+ parameters :
219+ deploy_all_tasks : ${{ eq(parameters.task_deployment, 'Deploy all Tasks') }}
220+
0 commit comments