forked from appveyor/build-images
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ubuntu1804.json
281 lines (276 loc) · 10.2 KB
/
ubuntu1804.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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
{
"variables": {
"iso_url": "http://cdimage.ubuntu.com/releases/bionic/release/ubuntu-18.04.3-server-amd64.iso",
"iso_checksum": "7d8e0055d663bffa27c1718685085626cb59346e7626ba3d3f476322271f573e",
"iso_checksum_type": "sha256",
"azure_vm_size": "Standard_D2s_v3",
"azure_storage_account": ""
},
"provisioners": [
{
"type": "file",
"source": "{{ template_dir }}/scripts/Ubuntu/custom-scripts",
"destination": "./custom-scripts"
},
{
"type": "file",
"source": "{{ template_dir }}/scripts/Ubuntu/",
"destination": "./"
},
{
"type": "shell",
"environment_vars": [
"USER_NAME={{ user `install_user` }}",
"USER_PASSWORD={{ user `install_password` }}",
"USER_HOME={{ user `install_home` }}",
"APPVEYOR_BUILD_AGENT_VERSION={{user `APPVEYOR_BUILD_AGENT_VERSION` }}",
"DATEMARK={{ user `datemark` }}",
"OPT_FEATURES={{ user `opt_features` }}"
],
"execute_command": "echo '{{ user `install_password` }}' | {{.Vars}} sudo -S -E bash -eu '{{.Path}}' {{user `deploy_parts`}}",
"scripts": [
"{{ template_dir }}/scripts/Ubuntu/basicconfig.sh"
]
},
{
"type": "shell",
"scripts":[
"{{ template_dir }}/scripts/Ubuntu/run_custom_scripts.sh"
]
},
{
"type": "file",
"direction": "download",
"source": "versions.log",
"destination": "./"
},
{
"type": "shell",
"inline": [
"if [ -f .ssh/authorized_keys ]; then rm .ssh/authorized_keys; fi",
"find . -maxdepth 1 -name 'script_*.sh-*.log' -delete"
]
}
],
"builders": [
{
"type": "googlecompute",
"account_file": "{{user `gce_account_file`}}",
"project_id": "{{ user `gce_project` }}",
"zone": "{{ user `gce_zone` }}",
"source_image_family": "ubuntu-1804-lts",
"state_timeout" : "15m",
"scopes": [
"https://www.googleapis.com/auth/userinfo.email",
"https://www.googleapis.com/auth/compute",
"https://www.googleapis.com/auth/devstorage.full_control",
"https://www.googleapis.com/auth/devstorage.read_only",
"https://www.googleapis.com/auth/logging.write",
"https://www.googleapis.com/auth/monitoring.write",
"https://www.googleapis.com/auth/servicecontrol",
"https://www.googleapis.com/auth/service.management.readonly",
"https://www.googleapis.com/auth/trace.append"
],
"machine_type": "n1-standard-2",
"ssh_username": "{{ user `install_user` }}",
"instance_name": "appveyor-ubuntu1804-{{ user `gce_zone` }}-{{timestamp}}",
"image_name": "appveyor-ubuntu1804-{{ user `gce_zone` }}-{{timestamp}}",
"image_description": "{{ user `image_description` }}",
"disk_size": 70,
"disk_type": "pd-ssd",
"image_licenses": ["projects/vm-options/global/licenses/enable-vmx"]
},
{
"type": "hyperv-iso",
"boot_command": [
"<esc><wait10><esc><esc><enter><wait>",
"linux /install/vmlinuz ",
" netcfg/disable_autoconfig=true<wait>",
" netcfg/get_ipaddress={{ user `host_ip_addr` }}<wait>",
" netcfg/get_netmask={{ user `host_ip_mask` }}<wait>",
" netcfg/get_gateway={{ user `host_ip_gw` }}<wait>",
" preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed18.cfg<wait>",
" netcfg/get_nameservers=8.8.8.8",
" debian-installer=en_US.UTF-8 auto locale=en_US.UTF-8 kbd-chooser/method=us",
" hostname={{.Name}} domain= ",
" fb=false debconf/frontend=noninteractive",
" keyboard-configuration/modelcode=SKIP keyboard-configuration/layout=USA",
" keyboard-configuration/variant=USA console-setup/ask_detect=false<enter>",
"initrd /install/initrd.gz<enter>",
"boot<enter>"
],
"boot_wait": "10s",
"http_directory": "{{ template_dir }}/http",
"iso_url": "{{user `iso_url`}}",
"iso_checksum": "{{user `iso_checksum`}}",
"iso_checksum_type": "{{user `iso_checksum_type`}}",
"ssh_host": "{{ user `host_ip_addr` }}",
"ssh_username": "{{ user `install_user` }}",
"ssh_password": "{{ user `install_password` }}",
"ssh_timeout" : "1h",
"shutdown_command": "echo '{{ user `install_password` }}' | sudo -S shutdown -P now",
"output_directory": "{{user `output_directory`}}",
"switch_name": "{{user `hyperv_switchname`}}",
"http_port_min": "{{user `http_port_min`}}",
"http_port_max": "{{user `http_port_max`}}",
"cpus": "{{user `cpus`}}",
"memory": "{{user `memory`}}",
"disk_size": "{{user `disk_size`}}",
"enable_secure_boot": false,
"disk_block_size": "1",
"generation": 2,
"temp_path": "{{user `packer_temp_dir`}}"
},
{
"type": "amazon-ebs",
"access_key": "{{user `aws_access_key`}}",
"secret_key": "{{user `aws_secret_key`}}",
"region": "{{user `aws_region`}}",
"security_group_id": "{{user `aws_security_group_id`}}",
"subnet_id": "{{user `aws_subnet_id`}}",
"associate_public_ip_address": true,
"source_ami_filter": {
"filters": {
"virtualization-type": "hvm",
"name": "ubuntu/images/*ubuntu-bionic-18.04-amd64-server-*",
"root-device-type": "ebs"
},
"owners": ["099720109477"],
"most_recent": true
},
"instance_type": "m5.large",
"ssh_username": "ubuntu",
"ami_name": "appveyor-ubuntu1804-{{user `aws_region`}}-{{timestamp}}",
"ami_description": "{{user `image_description`}}",
"launch_block_device_mappings": [
{
"device_name": "/dev/sda1",
"volume_size": 70,
"volume_type": "gp2",
"delete_on_termination": true
}
]
},
{
"type": "virtualbox-iso",
"boot_command": [
"<esc><wait>",
"<esc><wait>",
"<enter><wait>",
"/install/vmlinuz<wait>",
" initrd=/install/initrd.gz<wait>",
" auto-install/enable=true<wait>",
" debconf/priority=critical<wait>",
" noapic<wait>",
" netcfg/disable_autoconfig=true<wait>",
" netcfg/get_ipaddress={{ user `host_ip_addr` }}<wait>",
" netcfg/get_netmask={{ user `host_ip_mask` }}<wait>",
" netcfg/get_gateway={{ user `host_ip_gw` }}<wait>",
" preseed/url=http://{{ user `host_ip_gw` }}:{{ .HTTPPort }}/preseed18.cfg<wait>",
" netcfg/get_nameservers=8.8.8.8",
" hostname={{.Name}} domain= ",
" -- <wait>",
"<enter><wait>"
],
"boot_wait": "10s",
"cpus": 1,
"memory": 3072,
"disk_size": 40960,
"guest_os_type": "Ubuntu_64",
"headless": true,
"http_directory": "http",
"iso_urls": [
"iso/ubuntu-18.04.3-server-amd64.iso",
"http://cdimage.ubuntu.com/releases/bionic/release/ubuntu-18.04.3-server-amd64.iso"
],
"iso_checksum": "{{user `iso_checksum_md5`}}",
"iso_checksum_type": "md5",
"ssh_username": "{{ user `install_user` }}",
"ssh_password": "{{ user `install_password` }}",
"ssh_port": 22,
"ssh_wait_timeout": "10000s",
"ssh_host": "{{user `host_ip_addr`}}",
"ssh_skip_nat_mapping": "true",
"shutdown_command": "echo '{{ user `install_password` }}'|sudo -S shutdown -P now",
"guest_additions_path": "VBoxGuestAdditions_{{.Version}}.iso",
"virtualbox_version_file": ".vbox_version",
"vm_name": "packer-ubuntu-18.04",
"vboxmanage": [
[ "modifyvm", "{{.Name}}", "--nic1", "hostonly" ],
[ "modifyvm", "{{.Name}}", "--hostonlyadapter1", "vboxnet0" ],
[ "modifyvm", "{{.Name}}", "--nicpromisc1", "allow-all" ],
[ "modifyvm", "{{.Name}}", "--cableconnected1", "on" ]
]
},
{
"type": "parallels-iso",
"guest_os_type": "ubuntu",
"parallels_tools_flavor": "lin",
"boot_command": [
"<esc><wait>",
"<esc><wait>",
"<enter><wait>",
"/install/vmlinuz<wait>",
" initrd=/install/initrd.gz<wait>",
" auto-install/enable=true<wait>",
" debconf/priority=critical<wait>",
" noapic<wait>",
" preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed18.cfg<wait>",
" netcfg/get_nameservers=8.8.8.8",
" hostname={{.Name}} domain= ",
" -- <wait>",
"<enter><wait>"
],
"boot_wait": "10s",
"cpus": 1,
"memory": 3072,
"disk_size": 40960,
"http_directory": "http",
"iso_urls": [
"iso/ubuntu-18.04.3-server-amd64.iso",
"http://cdimage.ubuntu.com/releases/bionic/release/ubuntu-18.04.3-server-amd64.iso"
],
"iso_checksum": "{{user `iso_checksum_md5`}}",
"iso_checksum_type": "md5",
"ssh_username": "{{ user `install_user` }}",
"ssh_password": "{{ user `install_password` }}",
"ssh_port": 22,
"ssh_wait_timeout": "10000s",
"shutdown_command": "echo '{{ user `install_password` }}'|sudo -S shutdown -P now",
"vm_name": "packer-ubuntu-18.04"
},
{
"type": "azure-arm",
"subscription_id": "{{ user `azure_subscription_id` }}",
"client_id": "{{ user `azure_client_id` }}",
"client_secret": "{{ user `azure_client_secret` }}",
"location": "{{ user `azure_location` }}",
"temp_resource_group_name": "packer-appveyor-ubuntu1804-{{uuid}}",
"temp_compute_name": "packer-appveyor-ubuntu1804-{{uuid}}",
"os_type": "Linux",
"image_publisher": "Canonical",
"image_offer": "UbuntuServer",
"image_sku": "18.04-LTS",
"vm_size": "{{user `azure_vm_size`}}",
"os_disk_size_gb": 100,
"capture_container_name": "appveyor-ubuntu1804",
"capture_name_prefix": "{{user `datemark`}}",
"resource_group_name": "{{ user `azure_resource_group_name` }}",
"storage_account": "{{ user `azure_storage_account` }}",
"communicator": "ssh",
"azure_tags": {
"automation": "packer",
"OS": "ubuntu1804",
"description": "{{user `image_description`}}",
"date": "{{user `datemark`}}"
}
}
],
"post-processors": [
{
"type": "manifest",
"output": "{{user `packer_manifest`}}",
"strip_path": true
}
]
}