-
Notifications
You must be signed in to change notification settings - Fork 7
/
build-images.yml
124 lines (113 loc) · 3.71 KB
/
build-images.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
# The Service Connection (Principal) for this pipeline requires Storage Data (Reader) access to the subscription
# This pipeline will create a storage account to temporarily store a VHD
parameters:
- name: imageRepoRef
displayName: Image ref
type: string
default: 'refs/heads/main'
- name: image
displayName: Image
type: string
default: Latest
values:
- All
- Latest
- Stable
- Ubuntu
- Ubuntu2004
- Ubuntu2204
- Windows
- Windows2019
- Windows2022
- name: destroy
displayName: Destroy Infrastructure
type: boolean
default: true
- name: excludeFromLatest
displayName: Exclude from latest
type: boolean
default: true
- name: numberOfVersionsToKeep
displayName: Number of image versions to keep
type: number
default: 10
- name: addMinorImageVersion
displayName: Create minor version if major version exists
type: boolean
default: false
name: $(Date:yyyyMMdd)$(Rev:.r)-$(Build.DefinitionVersion)-$(SourceBranchName)-${{ lower(parameters.image) }}-$(Build.BuildId)
resources:
repositories:
- repository: runner-images
type: github
endpoint: github.com # Service Connection name
name: actions/runner-images
ref: ${{ parameters.imageRepoRef }}
trigger: none
pr:
autoCancel: false
branches:
include:
- '*'
paths:
exclude:
- '.devcontainer/**'
- 'visuals/**'
- '*.md'
schedules:
- cron: '0 12 * * *'
displayName: 'Weekly build (UTC)'
always: 'true' # Run if there are no changes
branches:
include:
- master
variables:
- group: 'build-images-isolated'
# - group: 'build-images'
# Variable group should set these variables:
# PIPELINE_DEMO_PACKER_LOCATION
# PIPELINE_DEMO_COMPUTE_GALLERY_NAME
# PIPELINE_DEMO_COMPUTE_GALLERY_RESOURCE_GROUP_NAME
- name: imageRepoRef
value: ${{ parameters.imageRepoRef }}
jobs:
- ${{ if in(parameters.image,'All','Stable','Ubuntu','Ubuntu2004') }}:
- template: build-image-template.yml
parameters:
addMinorImageVersion: ${{ parameters.addMinorImageVersion }}
destroy: ${{ parameters.destroy }}
excludeFromLatest: ${{ parameters.excludeFromLatest }}
image: Ubuntu2004
imageReleaseName: ubuntu20
imageResourceGroup: 'pipeline-image-$(Build.BuildId)-u20'
numberOfVersionsToKeep: ${{ parameters.numberOfVersionsToKeep }}
- ${{ if in(parameters.image,'All','Latest','Ubuntu','Ubuntu2204') }}:
- template: build-image-template.yml
parameters:
addMinorImageVersion: ${{ parameters.addMinorImageVersion }}
destroy: ${{ parameters.destroy }}
excludeFromLatest: ${{ parameters.excludeFromLatest }}
image: Ubuntu2204
imageReleaseName: ubuntu22
imageResourceGroup: 'pipeline-image-$(Build.BuildId)-u22'
numberOfVersionsToKeep: ${{ parameters.numberOfVersionsToKeep }}
- ${{ if in(parameters.image,'All','Stable','Windows','Windows2019') }}:
- template: build-image-template.yml
parameters:
addMinorImageVersion: ${{ parameters.addMinorImageVersion }}
destroy: ${{ parameters.destroy }}
excludeFromLatest: ${{ parameters.excludeFromLatest }}
image: Windows2019
imageReleaseName: win19
imageResourceGroup: 'pipeline-image-$(Build.BuildId)-w19'
numberOfVersionsToKeep: ${{ parameters.numberOfVersionsToKeep }}
- ${{ if in(parameters.image,'All','Latest','Windows','Windows2022') }}:
- template: build-image-template.yml
parameters:
addMinorImageVersion: ${{ parameters.addMinorImageVersion }}
destroy: ${{ parameters.destroy }}
excludeFromLatest: ${{ parameters.excludeFromLatest }}
image: Windows2022
imageReleaseName: win22
imageResourceGroup: 'pipeline-image-$(Build.BuildId)-w22'
numberOfVersionsToKeep: ${{ parameters.numberOfVersionsToKeep }}