blob: b972468685dfa09024215e8d782bad6558ea6def [file] [log] [blame]
jan kaufmana519d7b2015-03-04 00:51:47 +01001{
2 "variables": {
Filip Pytloun077322e2015-06-25 19:18:33 +02003 "user": "{{ env `BUILD_USER` }}",
4 "password": "{{ env `BUILD_PASSWORD` }}",
jan kaufmana519d7b2015-03-04 00:51:47 +01005 "do_api_token": "{{ env `DO_API_TOKEN` }}",
6 "distro": "ubuntu-14-04-x64",
Filip Pytloun39832362015-06-25 18:05:47 +02007 "disk_size": "8000"
jan kaufmana519d7b2015-03-04 00:51:47 +01008 },
9
10 "provisioners": [
11 {
12 "type": "shell",
13 "execute_command": "echo '{{user `user`}}' |sudo -S sh '{{.Path}}'",
14 "override": {
15 "virtualbox-iso": {
16 "scripts": [
17 "scripts/base.sh",
18 "scripts/salt.sh",
19 "scripts/vagrant.sh",
20 "scripts/virtualbox.sh",
21 "scripts/cleanup.sh",
22 "scripts/zerodisk.sh"
23 ]
24 },
25 "vmware-iso": {
26 "scripts": [
27 "scripts/base.sh",
jan kaufmandfc08f02015-04-29 20:17:55 +020028 "scripts/salt.sh",
jan kaufmana519d7b2015-03-04 00:51:47 +010029 "scripts/vmware.sh",
30 "scripts/cleanup.sh",
31 "scripts/zerodisk.sh"
32 ]
33 },
34 "qemu": {
35 "scripts": [
36 "scripts/base.sh",
37 "scripts/salt.sh",
38 "scripts/cleanup.sh",
39 "scripts/zerodisk.sh"
40 ]
41 },
42 "digitalocean": {
43 "scripts": [
44 "scripts/base.sh",
45 "scripts/salt.sh",
46 "scripts/cleanup.sh"
47 ]
48 }
49 }
jan kaufman0fcf1a72015-05-06 10:16:12 +020050 },
51 {
52 "type": "file",
53 "source": "configs/cloud/cloud.cfg.d/99_tcp.cfg",
54 "destination": "/etc/cloud/cloud.cfg.d/99_tcp.cfg"
Filip Pytloun60411d12015-06-25 21:14:41 +020055 },
56 {
57 "type": "file",
58 "source": "configs/cloud/cloud.cfg",
59 "destination": "/etc/cloud/cloud.cfg"
jan kaufmana519d7b2015-03-04 00:51:47 +010060 }
61 ],
62 "post-processors": [
63 {
64 "type": "vagrant",
65 "keep_input_artifact": true,
66 "except": "digitalocean",
67 "override": {
68 "virtualbox": {
jan kaufmandfc08f02015-04-29 20:17:55 +020069 "output": "images/{{ user `distro` }}-vbox-{{ timestamp }}.box"
jan kaufmana519d7b2015-03-04 00:51:47 +010070 },
71 "vmware": {
jan kaufmandfc08f02015-04-29 20:17:55 +020072 "output": "images/{{ user `distro` }}-vmware-{{ timestamp }}.box"
jan kaufmana519d7b2015-03-04 00:51:47 +010073 },
74 "qemu": {
jan kaufmandfc08f02015-04-29 20:17:55 +020075 "output": "images/{{ user `distro` }}-qemu-{{ timestamp }}.box"
jan kaufmana519d7b2015-03-04 00:51:47 +010076 }
77 },
78 "except": [ "digitalocean" ]
79 }
80 ],
81 "builders": [
82 {
83 "type": "virtualbox-iso",
84 "boot_command": [
85 "<esc><wait>",
86 "<esc><wait>",
87 "<enter><wait>",
88 "/install/vmlinuz<wait>",
89 " auto<wait>",
90 " console-setup/ask_detect=false<wait>",
91 " console-setup/layoutcode=us<wait>",
92 " console-setup/modelcode=pc105<wait>",
93 " debconf/frontend=noninteractive<wait>",
94 " debian-installer=en_US<wait>",
95 " fb=false<wait>",
96 " initrd=/install/initrd.gz<wait>",
97 " kbd-chooser/method=us<wait>",
98 " keyboard-configuration/layout=USA<wait>",
99 " keyboard-configuration/variant=USA<wait>",
Filip Pytloun077322e2015-06-25 19:18:33 +0200100 " passwd/user-fullname={{user `user`}} ",
101 " passwd/user-password-again={{user `password`}} ",
102 " passwd/user-password={{user `password`}} ",
103 " passwd/username={{user `user`}} ",
jan kaufmana519d7b2015-03-04 00:51:47 +0100104 " locale=en_US<wait>",
105 " netcfg/get_hostname=ubuntu-1404<wait>",
jan kaufmandfc08f02015-04-29 20:17:55 +0200106 " netcfg/get_domain=cloudlab.cz<wait>",
jan kaufmana519d7b2015-03-04 00:51:47 +0100107 " noapic<wait>",
jan kaufmandfc08f02015-04-29 20:17:55 +0200108 " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed-lvm.cfg<wait>",
jan kaufmana519d7b2015-03-04 00:51:47 +0100109 " -- <wait>",
110 "<enter><wait>"
111 ],
112 "boot_wait": "5s",
113 "disk_size": "{{ user `disk_size`}}",
jan kaufmandfc08f02015-04-29 20:17:55 +0200114 "output_directory": "images/{{ user `distro` }}-vbox-{{ timestamp }}",
jan kaufmana519d7b2015-03-04 00:51:47 +0100115 "guest_os_type": "Ubuntu_64",
116 "http_directory": "http",
jan kaufmandfc08f02015-04-29 20:17:55 +0200117 "iso_checksum": "83aabd8dcf1e8f469f3c72fff2375195",
jan kaufmana519d7b2015-03-04 00:51:47 +0100118 "iso_checksum_type": "md5",
jan kaufmandfc08f02015-04-29 20:17:55 +0200119 "iso_url": "http://releases.ubuntu.com/14.04/ubuntu-14.04.2-server-amd64.iso",
jan kaufmana519d7b2015-03-04 00:51:47 +0100120 "ssh_username": "{{user `user`}}",
121 "ssh_password": "{{user `password`}}",
122 "ssh_port": 22,
123 "ssh_wait_timeout": "10000s",
124 "shutdown_command": "echo '{{user `password`}}'|sudo -S shutdown -P now",
125 "vboxmanage": [
126 [ "modifyvm", "{{.Name}}", "--memory", "1024" ],
127 [ "modifyvm", "{{.Name}}", "--cpus", "2" ]
128 ]
129 },
130 {
131 "type": "vmware-iso",
132 "boot_command": [
133 "<esc><wait>",
134 "<esc><wait>",
135 "<enter><wait>",
136 "/install/vmlinuz<wait>",
137 " auto<wait>",
138 " console-setup/ask_detect=false<wait>",
139 " console-setup/layoutcode=us<wait>",
140 " console-setup/modelcode=pc105<wait>",
141 " debconf/frontend=noninteractive<wait>",
142 " debian-installer=en_US<wait>",
143 " fb=false<wait>",
144 " initrd=/install/initrd.gz<wait>",
145 " kbd-chooser/method=us<wait>",
146 " keyboard-configuration/layout=USA<wait>",
147 " keyboard-configuration/variant=USA<wait>",
Filip Pytloun077322e2015-06-25 19:18:33 +0200148 " passwd/user-fullname={{user `user`}} ",
149 " passwd/user-password-again={{user `password`}} ",
150 " passwd/user-password={{user `password`}} ",
151 " passwd/username={{user `user`}} ",
jan kaufmana519d7b2015-03-04 00:51:47 +0100152 " locale=en_US<wait>",
153 " netcfg/get_hostname=ubuntu-1404<wait>",
jan kaufman605c2492015-03-10 15:35:43 +0100154 " netcfg/get_domain=changeme<wait>",
jan kaufmana519d7b2015-03-04 00:51:47 +0100155 " noapic<wait>",
jan kaufmandfc08f02015-04-29 20:17:55 +0200156 " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed-lvm.cfg<wait>",
jan kaufmana519d7b2015-03-04 00:51:47 +0100157 " -- <wait>",
158 "<enter><wait>"
159 ],
160 "boot_wait": "5s",
161 "disk_size": "{{ user `disk_size`}}",
jan kaufmandfc08f02015-04-29 20:17:55 +0200162 "disk_type_id": 4,
163 "vmdk_name": "{{ user `distro`}}",
164 "output_directory": "images/{{ user `distro` }}-vmware-{{ timestamp }}",
jan kaufmana519d7b2015-03-04 00:51:47 +0100165 "guest_os_type": "linux",
166 "http_directory": "http",
jan kaufmandfc08f02015-04-29 20:17:55 +0200167 "iso_checksum": "83aabd8dcf1e8f469f3c72fff2375195",
jan kaufmana519d7b2015-03-04 00:51:47 +0100168 "iso_checksum_type": "md5",
jan kaufmandfc08f02015-04-29 20:17:55 +0200169 "iso_url": "http://releases.ubuntu.com/14.04/ubuntu-14.04.2-server-amd64.iso",
jan kaufmana519d7b2015-03-04 00:51:47 +0100170 "ssh_username": "{{user `user`}}",
171 "ssh_password": "{{user `password`}}",
172 "ssh_port": 22,
173 "ssh_wait_timeout": "10000s",
174 "shutdown_command": "echo '{{user `password`}}'|sudo -S shutdown -P now",
175 "vmx_data": {
jan kaufmandfc08f02015-04-29 20:17:55 +0200176 "memsize": "1024",
jan kaufmana519d7b2015-03-04 00:51:47 +0100177 "numvcpus": "1",
178 "cpuid.coresPerSocket": "1"
179 }
180 },
181 {
182 "type": "qemu",
183 "vm_name": "{{ user `distro` }}-{{ timestamp }}",
jan kaufmandfc08f02015-04-29 20:17:55 +0200184 "output_directory": "images/{{ user `distro` }}-qemu-{{ timestamp }}",
jan kaufmana519d7b2015-03-04 00:51:47 +0100185 "format": "qcow2",
186 "accelerator": "kvm",
187 "disk_size": "{{ user `disk_size`}}",
jan kaufmandfc08f02015-04-29 20:17:55 +0200188 "iso_url": "http://releases.ubuntu.com/14.04/ubuntu-14.04.2-server-amd64.iso",
jan kaufmana519d7b2015-03-04 00:51:47 +0100189 "iso_checksum_type": "md5",
jan kaufmandfc08f02015-04-29 20:17:55 +0200190 "iso_checksum": "83aabd8dcf1e8f469f3c72fff2375195",
jan kaufmana519d7b2015-03-04 00:51:47 +0100191 "http_directory": "http",
jan kaufman64b9f972015-03-11 11:31:28 +0100192 "headless": true,
jan kaufmana519d7b2015-03-04 00:51:47 +0100193 "ssh_username": "{{user `user`}}",
194 "ssh_password": "{{user `password`}}",
195 "shutdown_command": "echo '{{user `password`}}'|sudo -S shutdown -P now",
196 "boot_wait": "2s",
Filip Pytloun39832362015-06-25 18:05:47 +0200197 "ssh_wait_timeout": "10000s",
jan kaufmana519d7b2015-03-04 00:51:47 +0100198 "boot_command": [
199 "<esc><wait>",
200 "<esc><wait>",
201 "<enter><wait>",
202 "/install/vmlinuz<wait>",
203 " auto<wait>",
204 " console-setup/ask_detect=false<wait>",
205 " console-setup/layoutcode=us<wait>",
206 " console-setup/modelcode=pc105<wait>",
207 " debconf/frontend=noninteractive<wait>",
208 " debian-installer=en_US<wait>",
209 " fb=false<wait>",
210 " initrd=/install/initrd.gz<wait>",
211 " kbd-chooser/method=us<wait>",
212 " keyboard-configuration/layout=USA<wait>",
213 " keyboard-configuration/variant=USA<wait>",
Filip Pytloun077322e2015-06-25 19:18:33 +0200214 " passwd/user-fullname={{user `user`}} ",
215 " passwd/user-password-again={{user `password`}} ",
216 " passwd/user-password={{user `password`}} ",
217 " passwd/username={{user `user`}} ",
jan kaufmana519d7b2015-03-04 00:51:47 +0100218 " locale=en_US<wait>",
219 " netcfg/get_hostname=ubuntu-1404<wait>",
jan kaufman605c2492015-03-10 15:35:43 +0100220 " netcfg/get_domain=changeme<wait>",
jan kaufmana519d7b2015-03-04 00:51:47 +0100221 " noapic<wait>",
jan kaufman757e3322015-03-11 11:30:59 +0100222 " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed-lvm.cfg<wait>",
jan kaufmana519d7b2015-03-04 00:51:47 +0100223 " -- <wait>",
224 "<enter><wait>"
225 ]
226 },
Filip Pytloun077322e2015-06-25 19:18:33 +0200227 {
jan kaufmana519d7b2015-03-04 00:51:47 +0100228 "type": "digitalocean",
229 "api_token": "{{user `do_api_token`}}",
230 "image": "{{user `distro`}}",
231 "snapshot_name": "{{ user `distro` }}-{{ timestamp }}",
232 "region" : "ams2",
233 "size" : "1gb"
234 }
235 ]
236}