github.com/schwarzm/garden-linux@v0.0.0-20150507151835-33bca2147c47/packer/garden-ci/garden-ci.json (about) 1 { 2 "variables": { 3 "os_name": "ubuntu", 4 "os_version": "14.04", 5 "os_type": "Ubuntu_64", 6 "os_arch": "amd64", 7 "os_url": "http://releases.ubuntu.com/14.04/ubuntu-14.04.2-server-amd64.iso", 8 "os_md5_checksum": "83aabd8dcf1e8f469f3c72fff2375195", 9 "vm_name": "garden-ci.ubuntu.virtualbox", 10 "vm_hostname": "garden-ci-ubuntu", 11 "aws_key": "{{env `GARDEN_PACKER_AMAZON_ACCESS_KEY`}}", 12 "aws_secret": "{{env `GARDEN_PACKER_AMAZON_SECRET_KEY`}}" 13 }, 14 "builders": [ 15 { 16 "type": "docker", 17 "image": "{{user `os_name`}}:{{user `os_version`}}", 18 "commit": true 19 }, 20 { 21 "name": "garden-ci-virtualbox-iso", 22 "vm_name": "{{user `vm_name`}}", 23 "output_directory": "garden-ci/output", 24 "type": "virtualbox-iso", 25 "headless": true, 26 "guest_os_type": "{{user `os_type`}}", 27 "iso_checksum_type": "md5", 28 "iso_checksum": "{{user `os_md5_checksum`}}", 29 "iso_url": "{{user `os_url`}}", 30 "ssh_username": "vagrant", 31 "ssh_password": "vagrant", 32 "http_directory": "garden-ci/http", 33 "shutdown_command": "echo vagrant | sudo -S shutdown -P now", 34 "boot_command": [ 35 "<esc><esc><enter><wait>", 36 "/install/vmlinuz ", 37 "preseed/url=http://{{.HTTPIP}}:{{.HTTPPort}}/preseed.cfg ", 38 "debian-installer=en_US auto locale=en_US kbd-chooser/method=us ", 39 "hostname={{.Name}} ", 40 "fb=false debconf/frontend=noninteractive ", 41 "keyboard-configuration/modelcode=SKIP keyboard-configuration/layout=USA ", 42 "keyboard-configuration/variant=USA console-setup/ask_detect=false ", 43 "initrd=/install/initrd.gz -- <enter>" 44 ] 45 }, 46 { 47 "type": "amazon-ebs", 48 "access_key": "{{user `aws_key`}}", 49 "secret_key": "{{user `aws_secret`}}", 50 "region": "us-east-1", 51 "source_ami": "ami-e63b3e8e", 52 "instance_type": "m3.large", 53 "ssh_username": "ubuntu", 54 "ami_name": "garden-ci-ubuntu-ami-{{timestamp}}" 55 } 56 ], 57 "provisioners": [ 58 { 59 "type": "shell", 60 "scripts": [ 61 "garden-ci/scripts/passwordless_sudo.sh" 62 ], 63 "override": { 64 "garden-ci-virtualbox-iso": { 65 "scripts": [ 66 "garden-ci/scripts/passwordless_sudo.sh", 67 "garden-ci/scripts/vagrant_passwordless_sudo.sh" 68 ], 69 "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} echo vagrant | sudo -S {{ .Path }}" 70 }, 71 "amazon-ebs": { 72 "scripts": [ 73 "garden-ci/scripts/passwordless_sudo.sh", 74 "garden-ci/scripts/amazon_ebs_passwordless_sudo.sh" 75 ], 76 "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} sudo {{ .Path }}" 77 } 78 } 79 }, 80 { 81 "type": "shell", 82 "scripts": [ 83 "garden-ci/scripts/provision.sh" 84 ], 85 "override": { 86 "garden-ci-virtualbox-iso": { 87 "scripts": [ 88 "garden-ci/scripts/provision.sh", 89 "garden-ci/scripts/vagrant_provision.sh", 90 "garden-ci/scripts/install_vbox_guest_additions.sh", 91 "garden-ci/scripts/add_insecure_vagrant_ssh_keys.sh", 92 "garden-ci/scripts/update_grub_config.sh" 93 ], 94 "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} sudo su -c {{.Path}} --login root" 95 }, 96 "amazon-ebs": { 97 "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} sudo su -c {{.Path}} --login root" 98 } 99 } 100 }, 101 { 102 "type": "file", 103 "source": "rootfs/busybox/busybox.tar", 104 "destination": "/opt/warden/rootfs.tar" 105 }, 106 { 107 "type": "file", 108 "source": "rootfs/ubuntu/ubuntu.tar", 109 "destination": "/opt/warden/nestable-rootfs.tar" 110 }, 111 { 112 "type": "file", 113 "source": "rootfs/fuse/fuse.tar", 114 "destination": "/opt/warden/fuse-rootfs.tar" 115 }, 116 { 117 "type": "file", 118 "source": "rootfs/docker_registry/docker_registry.tar", 119 "destination": "/opt/warden/docker-registry-rootfs.tar" 120 }, 121 { 122 "type": "shell", 123 "inline": ["mkdir /opt/warden/empty"] 124 }, 125 { 126 "type": "file", 127 "source": "rootfs/empty/hello", 128 "destination": "/opt/warden/empty/hello" 129 }, 130 { 131 "type": "shell", 132 "inline": ["chmod 0777 /opt/warden/empty/hello"] 133 }, 134 { 135 "type": "shell", 136 "script": "garden-ci/scripts/untar_rootfses.sh", 137 "override": { 138 "garden-ci-virtualbox-iso": { 139 "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} sudo {{ .Path }}" 140 }, 141 "amazon-ebs": { 142 "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} sudo {{ .Path }}" 143 } 144 } 145 }, 146 { 147 "type": "shell", 148 "script": "garden-ci/scripts/cleanup.sh", 149 "override": { 150 "garden-ci-virtualbox-iso": { 151 "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} sudo {{ .Path }}" 152 }, 153 "amazon-ebs": { 154 "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} sudo {{ .Path }}" 155 } 156 } 157 } 158 ], 159 "post-processors": [ 160 { 161 "type": "docker-tag", 162 "repository": "garden-ci-ubuntu", 163 "tag": "packer", 164 "only": ["docker"] 165 }, 166 { 167 "type": "vagrant", 168 "vagrantfile_template": "garden-ci/Vagrantfile.template", 169 "keep_input_artifact": true, 170 "output": "garden-ci/output/{{.BuildName}}.box", 171 "only": ["garden-ci-virtualbox-iso"] 172 } 173 ] 174 } 175