jan kaufman | a519d7b | 2015-03-04 00:51:47 +0100 | [diff] [blame] | 1 | { |
| 2 | "variables": { |
| 3 | "user": "{{ env `BUILD_USER` }}", |
| 4 | "password": "{{ env `BUILD_PASSWORD` }}", |
| 5 | "do_api_token": "{{ env `DO_API_TOKEN` }}", |
| 6 | "distro": "ubuntu-14-04-x64", |
| 7 | "disk_size": 8000 |
| 8 | }, |
| 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 kaufman | dfc08f0 | 2015-04-29 20:17:55 +0200 | [diff] [blame] | 28 | "scripts/salt.sh", |
jan kaufman | a519d7b | 2015-03-04 00:51:47 +0100 | [diff] [blame] | 29 | "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 | } |
| 50 | } |
| 51 | ], |
| 52 | "post-processors": [ |
| 53 | { |
| 54 | "type": "vagrant", |
| 55 | "keep_input_artifact": true, |
| 56 | "except": "digitalocean", |
| 57 | "override": { |
| 58 | "virtualbox": { |
jan kaufman | dfc08f0 | 2015-04-29 20:17:55 +0200 | [diff] [blame] | 59 | "output": "images/{{ user `distro` }}-vbox-{{ timestamp }}.box" |
jan kaufman | a519d7b | 2015-03-04 00:51:47 +0100 | [diff] [blame] | 60 | }, |
| 61 | "vmware": { |
jan kaufman | dfc08f0 | 2015-04-29 20:17:55 +0200 | [diff] [blame] | 62 | "output": "images/{{ user `distro` }}-vmware-{{ timestamp }}.box" |
jan kaufman | a519d7b | 2015-03-04 00:51:47 +0100 | [diff] [blame] | 63 | }, |
| 64 | "qemu": { |
jan kaufman | dfc08f0 | 2015-04-29 20:17:55 +0200 | [diff] [blame] | 65 | "output": "images/{{ user `distro` }}-qemu-{{ timestamp }}.box" |
jan kaufman | a519d7b | 2015-03-04 00:51:47 +0100 | [diff] [blame] | 66 | } |
| 67 | }, |
| 68 | "except": [ "digitalocean" ] |
| 69 | } |
| 70 | ], |
| 71 | "builders": [ |
| 72 | { |
| 73 | "type": "virtualbox-iso", |
| 74 | "boot_command": [ |
| 75 | "<esc><wait>", |
| 76 | "<esc><wait>", |
| 77 | "<enter><wait>", |
| 78 | "/install/vmlinuz<wait>", |
| 79 | " auto<wait>", |
| 80 | " console-setup/ask_detect=false<wait>", |
| 81 | " console-setup/layoutcode=us<wait>", |
| 82 | " console-setup/modelcode=pc105<wait>", |
| 83 | " debconf/frontend=noninteractive<wait>", |
| 84 | " debian-installer=en_US<wait>", |
| 85 | " fb=false<wait>", |
| 86 | " initrd=/install/initrd.gz<wait>", |
| 87 | " kbd-chooser/method=us<wait>", |
| 88 | " keyboard-configuration/layout=USA<wait>", |
| 89 | " keyboard-configuration/variant=USA<wait>", |
| 90 | " passwd/user-fullname={{user `user`}} ", |
| 91 | " passwd/user-password-again={{user `password`}} ", |
| 92 | " passwd/user-password={{user `password`}} ", |
| 93 | " passwd/username={{user `user`}} ", |
| 94 | " locale=en_US<wait>", |
| 95 | " netcfg/get_hostname=ubuntu-1404<wait>", |
jan kaufman | dfc08f0 | 2015-04-29 20:17:55 +0200 | [diff] [blame] | 96 | " netcfg/get_domain=cloudlab.cz<wait>", |
jan kaufman | a519d7b | 2015-03-04 00:51:47 +0100 | [diff] [blame] | 97 | " noapic<wait>", |
jan kaufman | dfc08f0 | 2015-04-29 20:17:55 +0200 | [diff] [blame] | 98 | " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed-lvm.cfg<wait>", |
jan kaufman | a519d7b | 2015-03-04 00:51:47 +0100 | [diff] [blame] | 99 | " -- <wait>", |
| 100 | "<enter><wait>" |
| 101 | ], |
| 102 | "boot_wait": "5s", |
| 103 | "disk_size": "{{ user `disk_size`}}", |
jan kaufman | dfc08f0 | 2015-04-29 20:17:55 +0200 | [diff] [blame] | 104 | "output_directory": "images/{{ user `distro` }}-vbox-{{ timestamp }}", |
jan kaufman | a519d7b | 2015-03-04 00:51:47 +0100 | [diff] [blame] | 105 | "guest_os_type": "Ubuntu_64", |
| 106 | "http_directory": "http", |
jan kaufman | dfc08f0 | 2015-04-29 20:17:55 +0200 | [diff] [blame] | 107 | "iso_checksum": "83aabd8dcf1e8f469f3c72fff2375195", |
jan kaufman | a519d7b | 2015-03-04 00:51:47 +0100 | [diff] [blame] | 108 | "iso_checksum_type": "md5", |
jan kaufman | dfc08f0 | 2015-04-29 20:17:55 +0200 | [diff] [blame] | 109 | "iso_url": "http://releases.ubuntu.com/14.04/ubuntu-14.04.2-server-amd64.iso", |
jan kaufman | a519d7b | 2015-03-04 00:51:47 +0100 | [diff] [blame] | 110 | "ssh_username": "{{user `user`}}", |
| 111 | "ssh_password": "{{user `password`}}", |
| 112 | "ssh_port": 22, |
| 113 | "ssh_wait_timeout": "10000s", |
| 114 | "shutdown_command": "echo '{{user `password`}}'|sudo -S shutdown -P now", |
| 115 | "vboxmanage": [ |
| 116 | [ "modifyvm", "{{.Name}}", "--memory", "1024" ], |
| 117 | [ "modifyvm", "{{.Name}}", "--cpus", "2" ] |
| 118 | ] |
| 119 | }, |
| 120 | { |
| 121 | "type": "vmware-iso", |
| 122 | "boot_command": [ |
| 123 | "<esc><wait>", |
| 124 | "<esc><wait>", |
| 125 | "<enter><wait>", |
| 126 | "/install/vmlinuz<wait>", |
| 127 | " auto<wait>", |
| 128 | " console-setup/ask_detect=false<wait>", |
| 129 | " console-setup/layoutcode=us<wait>", |
| 130 | " console-setup/modelcode=pc105<wait>", |
| 131 | " debconf/frontend=noninteractive<wait>", |
| 132 | " debian-installer=en_US<wait>", |
| 133 | " fb=false<wait>", |
| 134 | " initrd=/install/initrd.gz<wait>", |
| 135 | " kbd-chooser/method=us<wait>", |
| 136 | " keyboard-configuration/layout=USA<wait>", |
| 137 | " keyboard-configuration/variant=USA<wait>", |
| 138 | " passwd/user-fullname={{user `user`}} ", |
| 139 | " passwd/user-password-again={{user `password`}} ", |
| 140 | " passwd/user-password={{user `password`}} ", |
| 141 | " passwd/username={{user `user`}} ", |
| 142 | " locale=en_US<wait>", |
| 143 | " netcfg/get_hostname=ubuntu-1404<wait>", |
jan kaufman | 605c249 | 2015-03-10 15:35:43 +0100 | [diff] [blame] | 144 | " netcfg/get_domain=changeme<wait>", |
jan kaufman | a519d7b | 2015-03-04 00:51:47 +0100 | [diff] [blame] | 145 | " noapic<wait>", |
jan kaufman | dfc08f0 | 2015-04-29 20:17:55 +0200 | [diff] [blame] | 146 | " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed-lvm.cfg<wait>", |
jan kaufman | a519d7b | 2015-03-04 00:51:47 +0100 | [diff] [blame] | 147 | " -- <wait>", |
| 148 | "<enter><wait>" |
| 149 | ], |
| 150 | "boot_wait": "5s", |
| 151 | "disk_size": "{{ user `disk_size`}}", |
jan kaufman | dfc08f0 | 2015-04-29 20:17:55 +0200 | [diff] [blame] | 152 | "disk_type_id": 4, |
| 153 | "vmdk_name": "{{ user `distro`}}", |
| 154 | "output_directory": "images/{{ user `distro` }}-vmware-{{ timestamp }}", |
jan kaufman | a519d7b | 2015-03-04 00:51:47 +0100 | [diff] [blame] | 155 | "guest_os_type": "linux", |
| 156 | "http_directory": "http", |
jan kaufman | dfc08f0 | 2015-04-29 20:17:55 +0200 | [diff] [blame] | 157 | "iso_checksum": "83aabd8dcf1e8f469f3c72fff2375195", |
jan kaufman | a519d7b | 2015-03-04 00:51:47 +0100 | [diff] [blame] | 158 | "iso_checksum_type": "md5", |
jan kaufman | dfc08f0 | 2015-04-29 20:17:55 +0200 | [diff] [blame] | 159 | "iso_url": "http://releases.ubuntu.com/14.04/ubuntu-14.04.2-server-amd64.iso", |
jan kaufman | a519d7b | 2015-03-04 00:51:47 +0100 | [diff] [blame] | 160 | "ssh_username": "{{user `user`}}", |
| 161 | "ssh_password": "{{user `password`}}", |
| 162 | "ssh_port": 22, |
| 163 | "ssh_wait_timeout": "10000s", |
| 164 | "shutdown_command": "echo '{{user `password`}}'|sudo -S shutdown -P now", |
| 165 | "vmx_data": { |
jan kaufman | dfc08f0 | 2015-04-29 20:17:55 +0200 | [diff] [blame] | 166 | "memsize": "1024", |
jan kaufman | a519d7b | 2015-03-04 00:51:47 +0100 | [diff] [blame] | 167 | "numvcpus": "1", |
| 168 | "cpuid.coresPerSocket": "1" |
| 169 | } |
| 170 | }, |
| 171 | { |
| 172 | "type": "qemu", |
| 173 | "vm_name": "{{ user `distro` }}-{{ timestamp }}", |
jan kaufman | dfc08f0 | 2015-04-29 20:17:55 +0200 | [diff] [blame] | 174 | "output_directory": "images/{{ user `distro` }}-qemu-{{ timestamp }}", |
jan kaufman | a519d7b | 2015-03-04 00:51:47 +0100 | [diff] [blame] | 175 | "format": "qcow2", |
| 176 | "accelerator": "kvm", |
| 177 | "disk_size": "{{ user `disk_size`}}", |
jan kaufman | dfc08f0 | 2015-04-29 20:17:55 +0200 | [diff] [blame] | 178 | "iso_url": "http://releases.ubuntu.com/14.04/ubuntu-14.04.2-server-amd64.iso", |
jan kaufman | a519d7b | 2015-03-04 00:51:47 +0100 | [diff] [blame] | 179 | "iso_checksum_type": "md5", |
jan kaufman | dfc08f0 | 2015-04-29 20:17:55 +0200 | [diff] [blame] | 180 | "iso_checksum": "83aabd8dcf1e8f469f3c72fff2375195", |
jan kaufman | a519d7b | 2015-03-04 00:51:47 +0100 | [diff] [blame] | 181 | "http_directory": "http", |
jan kaufman | 64b9f97 | 2015-03-11 11:31:28 +0100 | [diff] [blame] | 182 | "headless": true, |
jan kaufman | a519d7b | 2015-03-04 00:51:47 +0100 | [diff] [blame] | 183 | "ssh_username": "{{user `user`}}", |
| 184 | "ssh_password": "{{user `password`}}", |
| 185 | "shutdown_command": "echo '{{user `password`}}'|sudo -S shutdown -P now", |
| 186 | "boot_wait": "2s", |
| 187 | "boot_command": [ |
| 188 | "<esc><wait>", |
| 189 | "<esc><wait>", |
| 190 | "<enter><wait>", |
| 191 | "/install/vmlinuz<wait>", |
| 192 | " auto<wait>", |
| 193 | " console-setup/ask_detect=false<wait>", |
| 194 | " console-setup/layoutcode=us<wait>", |
| 195 | " console-setup/modelcode=pc105<wait>", |
| 196 | " debconf/frontend=noninteractive<wait>", |
| 197 | " debian-installer=en_US<wait>", |
| 198 | " fb=false<wait>", |
| 199 | " initrd=/install/initrd.gz<wait>", |
| 200 | " kbd-chooser/method=us<wait>", |
| 201 | " keyboard-configuration/layout=USA<wait>", |
| 202 | " keyboard-configuration/variant=USA<wait>", |
| 203 | " passwd/user-fullname={{user `user`}} ", |
| 204 | " passwd/user-password-again={{user `password`}} ", |
| 205 | " passwd/user-password={{user `password`}} ", |
| 206 | " passwd/username={{user `user`}} ", |
| 207 | " locale=en_US<wait>", |
| 208 | " netcfg/get_hostname=ubuntu-1404<wait>", |
jan kaufman | 605c249 | 2015-03-10 15:35:43 +0100 | [diff] [blame] | 209 | " netcfg/get_domain=changeme<wait>", |
jan kaufman | a519d7b | 2015-03-04 00:51:47 +0100 | [diff] [blame] | 210 | " noapic<wait>", |
jan kaufman | 757e332 | 2015-03-11 11:30:59 +0100 | [diff] [blame] | 211 | " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed-lvm.cfg<wait>", |
jan kaufman | a519d7b | 2015-03-04 00:51:47 +0100 | [diff] [blame] | 212 | " -- <wait>", |
| 213 | "<enter><wait>" |
| 214 | ] |
| 215 | }, |
| 216 | { |
| 217 | "type": "digitalocean", |
| 218 | "api_token": "{{user `do_api_token`}}", |
| 219 | "image": "{{user `distro`}}", |
| 220 | "snapshot_name": "{{ user `distro` }}-{{ timestamp }}", |
| 221 | "region" : "ams2", |
| 222 | "size" : "1gb" |
| 223 | } |
| 224 | ] |
| 225 | } |