Skip to content

Commit e574608

Browse files
Update common Docker engineering infrastructure with latest
1 parent 90964d7 commit e574608

File tree

5 files changed

+128
-50
lines changed

5 files changed

+128
-50
lines changed

eng/common/templates/1es-official.yml

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -38,23 +38,25 @@ resources:
3838
ref: refs/tags/release
3939

4040
extends:
41-
template: v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates
41+
template: /eng/common/templates/task-prefix-decorator.yml@self
4242
parameters:
43-
pool: ${{ parameters.pool }}
44-
sdl:
45-
binskim:
46-
enabled: true
47-
componentgovernance:
48-
ignoreDirectories: $(Build.SourcesDirectory)/versions
49-
whatIf: ${{ parameters.cgDryRun }}
50-
showAlertLink: true
51-
policheck:
52-
enabled: true
53-
sourceRepositoriesToScan:
54-
exclude:
55-
- repository: InternalVersionsRepo
56-
- repository: PublicVersionsRepo
57-
sourceAnalysisPool: ${{ parameters.sourceAnalysisPool }}
58-
tsa:
59-
enabled: true
43+
baseTemplate: v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates
44+
templateParameters:
45+
pool: ${{ parameters.pool }}
46+
sdl:
47+
binskim:
48+
enabled: true
49+
componentgovernance:
50+
ignoreDirectories: $(Build.SourcesDirectory)/versions
51+
whatIf: ${{ parameters.cgDryRun }}
52+
showAlertLink: true
53+
policheck:
54+
enabled: true
55+
sourceRepositoriesToScan:
56+
exclude:
57+
- repository: InternalVersionsRepo
58+
- repository: PublicVersionsRepo
59+
sourceAnalysisPool: ${{ parameters.sourceAnalysisPool }}
60+
tsa:
61+
enabled: true
6062
stages: ${{ parameters.stages }}

eng/common/templates/1es-unofficial.yml

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -41,26 +41,30 @@ resources:
4141
ref: refs/tags/release
4242

4343
extends:
44-
template: v1/1ES.Unofficial.PipelineTemplate.yml@1ESPipelineTemplates
44+
template: /eng/common/templates/task-prefix-decorator.yml@self
4545
parameters:
46-
pool: ${{ parameters.pool }}
47-
sdl:
48-
binskim:
49-
enabled: true
50-
componentgovernance:
51-
ignoreDirectories: $(Build.SourcesDirectory)/versions
52-
whatIf: true
53-
showAlertLink: true
54-
enableAllTools: ${{ not(parameters.disableSDL) }}
55-
policheck:
56-
enabled: true
57-
sbom:
58-
enabled: true
59-
sourceRepositoriesToScan:
60-
exclude:
61-
- repository: InternalVersionsRepo
62-
- repository: PublicVersionsRepo
63-
sourceAnalysisPool: ${{ parameters.sourceAnalysisPool }}
64-
tsa:
65-
enabled: true
46+
# Use a unique task prefix for unofficial pipelines
47+
taskPrefix: "🟦"
48+
baseTemplate: v1/1ES.Unofficial.PipelineTemplate.yml@1ESPipelineTemplates
49+
templateParameters:
50+
pool: ${{ parameters.pool }}
51+
sdl:
52+
binskim:
53+
enabled: true
54+
componentgovernance:
55+
ignoreDirectories: $(Build.SourcesDirectory)/versions
56+
whatIf: true
57+
showAlertLink: true
58+
enableAllTools: ${{ not(parameters.disableSDL) }}
59+
policheck:
60+
enabled: true
61+
sbom:
62+
enabled: true
63+
sourceRepositoriesToScan:
64+
exclude:
65+
- repository: InternalVersionsRepo
66+
- repository: PublicVersionsRepo
67+
sourceAnalysisPool: ${{ parameters.sourceAnalysisPool }}
68+
tsa:
69+
enabled: true
6670
stages: ${{ parameters.stages }}

eng/common/templates/jobs/publish.yml

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,15 @@ jobs:
183183
$(imageBuilder.commonCmdArgs)
184184
condition: and(succeeded(), eq(variables['publishImageInfo'], 'true'))
185185
displayName: Publish Image Info
186+
# Task displayNames names are hardcoded to reference the task prefix used by 1ES official
187+
# pipelines in eng/common/templates/1es-official.yml.
188+
#
189+
# These will fail if they are dependend on by an unofficial pipeline since they use a unique task
190+
# prefix compared to official pipelines (see eng/common/templates/1es-unofficial.yml). This is
191+
# acceptable because unofficial pipelines should not publish images.
192+
#
193+
# https://github.com/dotnet/docker-tools/issues/1698 tracks making this command no longer depend
194+
# on individual step displayNames.
186195
- script: >
187196
$(runImageBuilderCmd) postPublishNotification
188197
'$(publishNotificationRepoName)'
@@ -196,16 +205,16 @@ jobs:
196205
'$(gitHubNotificationsRepoInfo.org)'
197206
'$(gitHubNotificationsRepoInfo.repo)'
198207
--repo-prefix '$(publishRepoPrefix)'
199-
--task "Copy Images (Authenticated)"
200-
--task "Publish Manifest (Authenticated)"
201-
--task "Wait for Image Ingestion (Authenticated)"
202-
--task "Publish Readmes"
203-
--task "Wait for MCR Doc Ingestion (Authenticated)"
204-
--task "Publish Image Info"
205-
--task "Ingest Kusto Image Info (Authenticated)"
206-
--task "Generate EOL Annotation Data (Authenticated)"
207-
--task "Annotate EOL Images (Authenticated)"
208-
--task "Wait for Annotation Ingestion (Authenticated)"
208+
--task "🟪 Copy Images (Authenticated)"
209+
--task "🟪 Publish Manifest (Authenticated)"
210+
--task "🟪 Wait for Image Ingestion (Authenticated)"
211+
--task "🟪 Publish Readmes"
212+
--task "🟪 Wait for MCR Doc Ingestion (Authenticated)"
213+
--task "🟪 Publish Image Info"
214+
--task "🟪 Ingest Kusto Image Info (Authenticated)"
215+
--task "🟪 Generate EOL Annotation Data (Authenticated)"
216+
--task "🟪 Annotate EOL Images (Authenticated)"
217+
--task "🟪 Wait for Annotation Ingestion (Authenticated)"
209218
$(dryRunArg)
210219
$(imageBuilder.commonCmdArgs)
211220
displayName: Post Publish Notification
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# This Azure Pipelines template is adds a prefix to the display name of each
2+
# task passed through the `stages` parameter. When used in conjunction with
3+
# an "extends" template which injects a lot of tasks into the pipeline, the
4+
# added prefix helps to identify which tasks were passed through this template
5+
# and which tasks were injected by the `baseTemplate`.
6+
#
7+
# This template assumes that `baseTemplate` uses the `stages` parameter. If it
8+
# doesn't, this template likely won't work as expected.
9+
10+
parameters:
11+
# The pipeline will behave as if it were originally extended from this template,
12+
# except with updated task display names.
13+
- name: baseTemplate
14+
type: string
15+
default: ""
16+
17+
# These parameters are passed directly to `baseTemplate`
18+
- name: templateParameters
19+
type: object
20+
default: null
21+
22+
# These stages will be modified and passed to the `baseTemplate` as the
23+
# `stages` parameter. The
24+
- name: stages
25+
type: stageList
26+
default: []
27+
28+
# This prefix will be added to the display name of each task.
29+
- name: taskPrefix
30+
type: string
31+
default: "🟪"
32+
33+
34+
extends:
35+
template: ${{ parameters.baseTemplate }}
36+
parameters:
37+
${{ insert }}: ${{ parameters.templateParameters }}
38+
stages:
39+
- ${{ each stage in parameters.stages }}:
40+
- stage: ${{ stage.stage }}
41+
${{ each property in stage }}:
42+
${{ if notIn(property.key, 'stage', 'jobs') }}:
43+
${{ property.key }} : ${{ property.value }}
44+
jobs:
45+
- ${{ each job in stage.jobs }}:
46+
- job: ${{ job.job }}
47+
${{ each property in job }}:
48+
${{ if notIn(property.key, 'job', 'steps') }}:
49+
${{ property.key }} : ${{ property.value }}
50+
steps:
51+
- ${{ each step in job.steps }}:
52+
# Special case for Azure Pipelines checkout task:
53+
# https://learn.microsoft.com/azure/devops/extend/develop/pipeline-decorator-context?view=azure-devops#task-names-and-guids
54+
# The checkout task does not have a name - it is special and built directly into the agent.
55+
# Avoid modifying the checkout task, or else it will show up in the UI as a task with no name.
56+
- ${{ if contains(step.task, '6d15af64-176c-496d-b583-fd2ae21d4df4') }}:
57+
- ${{ step }}
58+
- ${{ else }}:
59+
- task: ${{ step.task }}
60+
${{ each property in step }}:
61+
${{ if notIn(property.key, 'task', 'displayName') }}:
62+
${{ property.key }} : ${{ property.value }}
63+
displayName: ${{ parameters.taskPrefix }} ${{ step.displayName }}

eng/common/templates/variables/docker-images.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
variables:
2-
imageNames.imageBuilderName: mcr.microsoft.com/dotnet-buildtools/image-builder:2702123
2+
imageNames.imageBuilderName: mcr.microsoft.com/dotnet-buildtools/image-builder:2708614
33
imageNames.imageBuilder: $(imageNames.imageBuilderName)
44
imageNames.imageBuilder.withrepo: imagebuilder-withrepo:$(Build.BuildId)-$(System.JobId)
55
imageNames.testRunner: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux3.0-docker-testrunner

0 commit comments

Comments
 (0)