Skip to content

Commit 353110d

Browse files
Fix Azure DevOps checkout step in the courtesy-push.js file (#21204)
* Creating a new token value using the get-AzDo-pat.yml * Creating a separate pipeline yml for release
1 parent def5bfd commit 353110d

File tree

6 files changed

+246
-149
lines changed

6 files changed

+246
-149
lines changed

.azure-pipelines/.vsts.release.yml

Lines changed: 220 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,220 @@
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+

azure-pipelines.yml

Lines changed: 7 additions & 142 deletions
Original file line numberDiff line numberDiff line change
@@ -12,77 +12,25 @@ resources:
1212
name: 1ESPipelineTemplates/1ESPipelineTemplates
1313
ref: refs/tags/release
1414

15-
parameters:
16-
- name: task_deployment
17-
displayName: Choose deployment options
18-
type: string
19-
default: 'Deploy task of Sprint'
20-
values:
21-
- 'Deploy all Tasks'
22-
- 'Deploy task of Sprint'
23-
- 'Deploy Hotfix'
24-
- name: task_name
25-
displayName: |
26-
To 'Deploy Hotfix' provide task names (e.g. BashV3,AzureCLIV1,PowerShellV2) else leave to default
27-
type: string
28-
default: 'TaskNameVN'
29-
- name: enableCodeQL
30-
displayName: Enable CodeQL for run
31-
type: boolean
32-
default: false
33-
- name: includeLocalPackagesBuildConfig
34-
displayName: Flag to update LocalPackages buildconfig (for testing, this will be made default later)
35-
type: boolean
36-
default: false # note: keep in sync with ci\ci-test-tasks\canary-tests-v2.yml
37-
- name: skip_publish
38-
displayName: skipPublish (Not for production use)
39-
type: boolean
40-
default: false
41-
- name: publishToDistributedTaskTest
42-
displayName: Publish to test feed (DistributedTasks-test), for infrastucture testing
43-
type: boolean
44-
default: false
45-
- name: dryRun
46-
displayName: Dry Run (no push, no PR, no feed publish)
47-
type: boolean
48-
default: false
49-
5015
variables:
5116
- name: currentDate
5217
value: $[ format('{0:yyyy}{0:MM}{0:dd}', pipeline.startTime) ]
5318
- name: taskName
54-
value: ${{ parameters.task_name }}
19+
value: 'TaskNameVN'
5520
- name: taskNameIsSet
56-
value: ${{ not(or(eq(parameters.task_deployment, 'Deploy all Tasks'), eq(parameters.task_deployment, 'Deploy task of Sprint'))) }}
21+
value: false
5722
- name: runCodeQl
58-
value: ${{ eq(parameters.enableCodeQL, true) }}
23+
value: false
5924
- name: system.debug
6025
value: true
6126
- name: includeLocalPackagesBuildConfigParameter
62-
${{ if eq(parameters.includeLocalPackagesBuildConfig, true) }}:
63-
value: '--includeLocalPackagesBuildConfig'
64-
${{ else }}:
65-
value: ''
27+
value: ''
6628
- name: IncludeLocalPackagesBuildConfigTest
67-
${{ if eq(parameters.includeLocalPackagesBuildConfig, true) }}:
68-
value: '1'
69-
${{ else }}:
70-
value: ''
71-
- name: tasksSkipPublish
72-
${{ if eq(parameters.skip_publish, true) }}:
73-
value: 'true'
74-
${{ else }}:
75-
value: 'false'
29+
value: ''
7630
- name: DEPLOY_ALL_TASKSVAR
77-
${{ if eq(parameters.task_deployment,'Deploy all Tasks') }}:
78-
value: 'true'
79-
${{ else }}:
80-
value: 'false'
31+
value: 'false'
8132
- name: isDryRun
82-
${{ if eq(parameters.dryRun, true) }}:
83-
value: 'true'
84-
${{ else }}:
85-
value: 'false'
33+
value: 'false'
8634

8735
extends:
8836
template: v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates
@@ -137,89 +85,6 @@ extends:
13785
parameters:
13886
os: Windows_NT
13987

140-
# Publish
141-
- job: publish
142-
displayName: Publish Nuget Artifacts
143-
timeoutInMinutes: 360
144-
dependsOn:
145-
- build_all_windows
146-
condition: and(succeeded(), ne(variables['build.reason'], 'PullRequest'), eq(variables['tasksSkipPublish'], 'false'))
147-
pool:
148-
name: 1ES-ABTT-Shared-Pool
149-
image: abtt-windows-2022
150-
os: windows
151-
templateContext:
152-
outputs:
153-
- output: buildArtifacts
154-
displayName: 'Publish per task NuGet package artifact'
155-
PathtoPublish: _package/nuget-packages
156-
ArtifactName: IndividualNuGetPackages
157-
steps:
158-
- template: /ci/publish-steps.yml@self
159-
160-
# Courtesy Push
161-
- job: courtesy_push
162-
displayName: Courtesy Push
163-
timeoutInMinutes: 180
164-
pool:
165-
name: 1ES-ABTT-Shared-Pool
166-
image: abtt-windows-2022
167-
os: windows
168-
dependsOn:
169-
- publish
170-
condition: |
171-
and(
172-
succeeded(),
173-
eq(variables['COURTESY_PUSH'], 'true'),
174-
or(
175-
eq(variables['build.reason'], 'Schedule'),
176-
and(
177-
eq(variables['build.reason'], 'Manual'),
178-
eq(variables['FORCE_COURTESY_PUSH'], 'true')
179-
)
180-
)
181-
)
182-
templateContext:
183-
outputs:
184-
- output: nuget
185-
packagesToPush: '$(Build.SourcesDirectory)/IndividualNugetPackagesDownloaded/IndividualNugetPackages/*/*.nupkg'
186-
packageParentPath: '$(Build.SourcesDirectory)'
187-
${{ if or(eq(parameters.dryRun, true),eq(parameters.publishToDistributedTaskTest, true)) }}:
188-
publishVstsFeed: 'c86767d8-af79-4303-a7e6-21da0ba435e2/9d34d871-8032-4e10-a34a-c7a01e125865'
189-
${{ else }}:
190-
publishVstsFeed: 'c86767d8-af79-4303-a7e6-21da0ba435e2/e10d0795-57cd-4d7f-904e-5f39703cb096'
191-
nuGetFeedType: internal
192-
displayName: Push Nuget package
193-
allowPackageConflicts: $(COURTESY_PUSH)
194-
steps:
195-
- checkout: self
196-
- template: /ci/courtesy-push.yml@self
197-
198-
- job: build_all_tasks_for_deployments
199-
displayName: Build all tasks for deployments (Windows)
200-
dependsOn:
201-
- courtesy_push
202-
- build_all_windows
203-
condition: succeeded()
204-
timeoutInMinutes: 360
205-
pool:
206-
name: 1ES-ABTT-Shared-Pool
207-
image: abtt-windows-2022
208-
os: windows
209-
variables:
210-
task_pattern: $[dependencies.build_all_windows.outputs['getTaskPattern.task_pattern']]
211-
templateContext:
212-
outputs:
213-
- output: buildArtifacts
214-
displayName: 'Publish package artifact'
215-
PathtoPublish: _package/tasks.zip
216-
sbomBuildDropPath: $(Build.SourcesDirectory)/_package
217-
ArtifactName: allTasks
218-
steps:
219-
- template: /ci/build-all-tasks.yml@self
220-
parameters:
221-
deploy_all_tasks: ${{ eq(parameters.task_deployment, 'Deploy all Tasks') }}
222-
22388
# All tasks on Linux
22489
- job: build_all_linux
22590
displayName: Build all tasks (Linux)

0 commit comments

Comments
 (0)