This repository has been archived by the owner on Oct 24, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 521
/
Copy pathwindows-vhd-builder.json
125 lines (125 loc) · 4.68 KB
/
windows-vhd-builder.json
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
125
{
"variables": {
"build_branch": "{{env `GIT_BRANCH`}}",
"build_commit": "{{env `GIT_VERSION`}}",
"build_id": "{{env `BUILD_ID`}}",
"build_number": "{{env `BUILD_NUMBER`}}",
"build_repo": "{{env `GIT_REPO`}}",
"client_id": "{{env `AZURE_CLIENT_ID`}}",
"client_secret": "{{env `AZURE_CLIENT_SECRET`}}",
"container_runtime": "{{env `CONTAINER_RUNTIME`}}",
"image_publisher": null,
"image_offer": null,
"image_sku": null,
"image_version": null,
"tenant_id": "{{env `AZURE_TENANT_ID`}}",
"subscription_id": "{{env `AZURE_SUBSCRIPTION_ID`}}",
"location": "{{env `AZURE_LOCATION`}}",
"vm_size": "{{env `AZURE_VM_SIZE`}}",
"windows_server_version": null
},
"builders": [
{
"type": "azure-arm",
"client_id": "{{user `client_id`}}",
"client_secret": "{{user `client_secret`}}",
"tenant_id": "{{user `tenant_id`}}",
"subscription_id": "{{user `subscription_id`}}",
"location": "{{user `location`}}",
"vm_size": "{{user `vm_size`}}",
"os_type": "Windows",
"image_publisher": "{{user `image_publisher`}}",
"image_offer": "{{user `image_offer`}}",
"image_sku": "{{user `image_sku`}}",
"image_version": "{{user `image_version`}}",
"resource_group_name": "{{user `resource_group_name`}}",
"capture_container_name": "aksengine-vhds-windows-{{user `windows_server_version`}}-{{user `container_runtime`}}",
"capture_name_prefix": "aksengine-{{user `create_time`}}",
"storage_account": "{{user `storage_account_name`}}",
"communicator": "winrm",
"winrm_use_ssl": true,
"winrm_insecure": true,
"winrm_timeout": "10m",
"winrm_username": "packer",
"azure_tags": {
"os": "Windows",
"now": "{{user `create_time`}}",
"createdBy": "aks-engine-vhd-pipeline",
"SkipASMAV": "true"
}
}
],
"provisioners": [
{
"elevated_user": "packer",
"elevated_password": "{{.WinRMPassword}}",
"environment_vars": [
"ProvisioningPhase=1",
"ContainerRuntime={{user `container_runtime`}}",
"windowsServerVersion={{user `windows_server_version`}}"
],
"type": "powershell",
"script": "vhd/packer/configure-windows-vhd.ps1"
},
{
"restart_timeout": "10m",
"type": "windows-restart"
},
{
"restart_timeout": "10m",
"type": "windows-restart"
},
{
"elevated_user": "packer",
"elevated_password": "{{.WinRMPassword}}",
"environment_vars": [
"ProvisioningPhase=2",
"ContainerRuntime={{user `container_runtime`}}",
"windowsServerVersion={{user `windows_server_version`}}"
],
"type": "powershell",
"script": "vhd/packer/configure-windows-vhd.ps1"
},
{
"restart_timeout": "10m",
"type": "windows-restart"
},
{
"type": "file",
"direction": "upload",
"source": "scripts/collect-windows-logs.ps1",
"destination": "c:\\akse-cache\\collect-windows-logs.ps1"
},
{
"type": "file",
"direction": "upload",
"source": "vhd/notice/notice_windows.txt",
"destination": "c:\\NOTICE.txt"
},
{
"elevated_user": "packer",
"elevated_password": "{{.WinRMPassword}}",
"environment_vars" : [
"BUILD_BRANCH={{user `build_branch`}}",
"BUILD_COMMIT={{user `build_commit`}}",
"BUILD_ID={{user `build_id`}}",
"BUILD_NUMBER={{user `build_number`}}",
"BUILD_REPO={{user `build_repo`}}"
],
"type": "powershell",
"script": "vhd/packer/write-release-notes-windows.ps1"
},
{
"type": "file",
"direction": "download",
"source": "c:\\release-notes.txt",
"destination": "release-notes.txt"
},
{
"elevated_user": "packer",
"elevated_password": "{{.WinRMPassword}}",
"type": "powershell",
"script": "vhd/packer/sysprep.ps1"
}
]
}