forked from YannickRe/azuredevops-buildagents
-
Notifications
You must be signed in to change notification settings - Fork 0
/
buildagent-generation-galleryvm.yml
50 lines (47 loc) · 1.79 KB
/
buildagent-generation-galleryvm.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
parameters:
- name: variable_group_name
displayName: Variable Group
type: string
default: 'Image Generation Variables'
- name: agent_pool
displayName: Agent Pool
type: string
default: CI Windows2019
- name: repository_base_path
displayName: Scripts Path
type: string
default: .
jobs:
- job: createvmimageversion
displayName: Create New Gallery VMImage Version
timeoutInMinutes: 600
cancelTimeoutInMinutes: 90
pool:
name: ${{ parameters.agent_pool }}
variables:
- name: GalleryVmImageDefinition
value: $[stageDependencies.buildagent_template_vm.generate_image.outputs['setVars.GalleryVmImageDefinition'] ]
- name: ManagedImageName
value: $[stageDependencies.buildagent_template_vm.generate_image.outputs['setVars.ManagedImageNameOutput'] ]
- group: ${{ parameters.variable_group_name }}
steps:
- checkout: self
- ${{ if ne(parameters.repository_base_path, '.') }}:
- checkout: ${{ parameters.repository_base_path }}
- task: PowerShell@2
displayName: 'Create new Gallery Virtual Machine Image version'
name: creategalleryimageversion
inputs:
targetType: filePath
filePath: ${{ parameters.repository_base_path }}/scripts/create-gallery-vmimageversion.ps1
arguments: -ManagedImageName $(ManagedImageName) `
-BuildId $(Build.BuildId) `
-ClientId $(CLIENT_ID) `
-ClientSecret $(CLIENT_SECRET) `
-ResourceGroup $(AZURE_RESOURCE_GROUP) `
-SubscriptionId $(AZURE_SUBSCRIPTION) `
-TenantId $(AZURE_TENANT) `
-Location $(AZURE_LOCATION) `
-GalleryName $(GALLERY_NAME) `
-GalleryResourceGroup $(GALLERY_RESOURCE_GROUP) `
-GalleryVmImageDefinition $(GalleryVmImageDefinition)