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