forked from Azure/acs-engine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvhd-image-builder.json
80 lines (80 loc) · 2.88 KB
/
vhd-image-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
{
"variables": {
"client_id": "{{env `AZURE_CLIENT_ID`}}",
"client_secret": "{{env `AZURE_CLIENT_SECRET`}}",
"tenant_id": "{{env `AZURE_TENANT_ID`}}",
"subscription_id": "{{env `AZURE_SUBSCRIPTION_ID`}}",
"location": "{{env `AZURE_LOCATION`}}",
"vm_size": "{{env `AZURE_VM_SIZE`}}",
"build_number": "{{env `BUILD_NUMBER`}}",
"build_id": "{{env `BUILD_ID`}}",
"commit": "{{env `GIT_VERSION`}}",
"feature_flags": "{{env `FEATURE_FLAGS`}}"
},
"builders": [
{
"type": "azure-arm",
"client_id": "{{user `client_id`}}",
"client_secret": "{{user `client_secret`}}",
"tenant_id": "{{user `tenant_id`}}",
"subscription_id": "{{user `subscription_id`}}",
"resource_group_name": "{{user `resource_group_name`}}",
"capture_container_name": "acsengine-vhds",
"capture_name_prefix": "acsengine-{{timestamp}}",
"storage_account": "{{user `storage_account_name`}}",
"os_type": "Linux",
"os_disk_size_gb": 30,
"image_publisher": "Canonical",
"image_offer": "UbuntuServer",
"image_sku": "16.04-LTS",
"image_version": "latest",
"azure_tags": {
"dept": "Azure Container Service"
},
"location": "{{user `location`}}",
"vm_size": "{{user `vm_size`}}"
}
],
"provisioners": [
{
"type": "shell",
"inline": [
"sudo mkdir -p /opt/azure/containers",
"sudo chown -R $USER /opt/azure/containers"
]
},
{
"type": "file",
"source": "packer/cleanup-vhd.sh",
"destination": "/home/packer/cleanup-vhd.sh"
},
{
"type": "file",
"source": "parts/k8s/kubernetesinstalls.sh",
"destination": "/home/packer/provision_installs.sh"
},
{
"type": "file",
"source": "parts/k8s/kubernetesprovisionsource.sh",
"destination": "/home/packer/provision_source.sh"
},
{
"type": "file",
"source": "packer/install-dependencies.sh",
"destination": "/home/packer/install-dependencies.sh"
},
{
"type": "file",
"source": "packer/feature-flagged.sh",
"destination": "/home/packer/feature-flagged.sh"
},
{
"type": "shell",
"inline": [
"sudo FEATURE_FLAGS={{user `feature_flags`}} BUILD_NUMBER={{user `build_number`}} BUILD_ID={{user `build_id`}} COMMIT={{user `commit`}} /bin/bash -ux /home/packer/install-dependencies.sh",
"sudo /bin/bash -eux /home/packer/cleanup-vhd.sh",
"sudo rm -rf /home/packer"
]
}
]
}