-
Notifications
You must be signed in to change notification settings - Fork 65
Expand file tree
/
Copy pathcheck-base-image-updates.yml
More file actions
85 lines (78 loc) · 2.98 KB
/
Copy pathcheck-base-image-updates.yml
File metadata and controls
85 lines (78 loc) · 2.98 KB
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
# This job template checks for stale images that need to be rebuilt due to base
# image updates. It copies base images to the staging registry, detects which
# images are stale, and queues builds for any images that need to be updated.
parameters:
# The name of the job (e.g., "CheckBaseImages").
- name: jobName
type: string
# Path to the subscriptions JSON file that defines which base images to monitor.
# Relative to the repo root.
- name: subscriptionsPath
type: string
# The name of the public Azure DevOps project (e.g., "public").
- name: publicProjectName
type: string
# The name of the internal Azure DevOps project (e.g., "internal").
- name: internalProjectName
type: string
# Publishing configuration containing registry and service connection settings.
# Schema is defined in src/ImageBuilder/Configuration/PublishConfiguration.cs.
- name: publishConfig
type: object
# When true, build ImageBuilder from source instead of pulling from MCR. Used
# during development to validate ImageBuilder and pipeline template changes
# together before a new ImageBuilder image is published.
- name: bootstrapImageBuilder
type: boolean
default: false
jobs:
- job: ${{ parameters.jobName }}
pool:
name: $(default1ESInternalPoolName)
image: $(default1ESInternalPoolImage)
os: linux
steps:
- template: /eng/docker-tools/templates/steps/init-common.yml@self
parameters:
dockerClientOS: linux
publishConfig: ${{ parameters.publishConfig }}
${{ if eq(parameters.bootstrapImageBuilder, true) }}:
customInitSteps:
- template: /eng/pipelines/templates/steps/bootstrap-imagebuilder.yml@self
- template: /eng/docker-tools/templates/steps/reference-service-connections.yml@self
parameters:
publishConfig: ${{ parameters.publishConfig }}
usesRegistries:
- ${{ parameters.publishConfig.MirrorRegistry.server }}
- template: /eng/docker-tools/templates/steps/copy-base-images.yml@self
parameters:
acr: ${{ parameters.publishConfig.MirrorRegistry }}
additionalOptions: "--subscriptions-path '${{ parameters.subscriptionsPath }}'"
- script: >
$(runAuthedImageBuilderCmd)
getStaleImages
$(dotnetDockerBot.userName)
$(dotnetDockerBot.email)
--gh-token $(BotAccount-dotnet-docker-bot-PAT)
staleImagePaths
--subscriptions-path ${{ parameters.subscriptionsPath }}
--os-type '*'
--architecture '*'
$(dockerHubRegistryCreds)
displayName: Get Stale Images
name: GetStaleImages
env:
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
SYSTEM_OIDCREQUESTURI: $(System.OidcRequestUri)
- script: >
$(runImageBuilderCmd)
queueBuild
$(System.AccessToken)
dnceng
internal
--gh-token '$(BotAccount-dotnet-docker-bot-PAT)'
--git-owner 'dotnet'
--git-repo '$(internalGitHubRepo)'
--subscriptions-path ${{ parameters.subscriptionsPath }}
--image-paths "$(GetStaleImages.staleImagePaths)"
displayName: Queue Build for Stale Images