Commit 13f768ce authored by Christian Rebischke's avatar Christian Rebischke
Browse files

added a possibility to build boxes locally



This approach disables vagrant cloud uploads.
It's supposed to fix #44
Signed-off-by: default avatarChristian Rebischke <chris@nullday.de>
parent e4bbbe0d
......@@ -40,11 +40,12 @@ Here is an overview over all variables you can set in `vagrant.json` or
the ISO before entering any command.
## how to start the build process locally
Edit the `local.json` before you start the build. set the right
`iso_url` and the right `iso_checksum_url`. Then you can start the build
If you want to build the boxes locally without uploading them to the Vagrant
cloud you need to edit the `local.json` before you start the build. set the
right `iso_url` and the right `iso_checksum_url`. Then you can start the build
for virtualbox only with the following command:
`packer build -only=virtualbox-iso -var-file=local.json vagrant.json`
`packer build -only=virtualbox-iso local.json`
## how to start the build process for official builds
The official builds are done on our Arch Linux Buildserver.
......
{
"variables": {
"iso_url": "https://mirror.rackspace.com/archlinux/iso/latest/archlinux-2018.10.01-x86_64.iso",
"iso_checksum_url": "https://mirror.rackspace.com/archlinux/iso/latest/sha1sums.txt",
"iso_checksum_type": "sha1",
......@@ -6,8 +8,144 @@
"memory": "1024",
"cpus": "2",
"headless": "true",
"vagrant_cloud_token": "PLACEHOLDER",
"write_zeroes": "",
"boot_wait": "60s"
},
"builders": [
{
"type": "virtualbox-iso",
"boot_wait": "{{user `boot_wait`}}",
"http_directory": "http",
"disk_size": "{{user `disk_size`}}",
"guest_os_type": "ArchLinux_64",
"iso_checksum_url": "{{user `iso_checksum_url`}}",
"iso_checksum_type": "{{user `iso_checksum_type`}}",
"iso_url": "{{user `iso_url`}}",
"ssh_username": "vagrant",
"ssh_password": "vagrant",
"ssh_port": 22,
"ssh_wait_timeout": "10000s",
"shutdown_command": "sudo systemctl poweroff",
"guest_additions_mode": "disable",
"headless": "{{user `headless`}}",
"vboxmanage": [
[
"modifyvm",
"{{.Name}}",
"--memory",
"{{user `memory`}}"
],
[
"modifyvm",
"{{.Name}}",
"--cpus",
"{{user `cpus`}}"
]
],
"boot_command": [
"<enter><wait10><wait10><wait10><wait10><wait10><enter><enter>",
"curl -O 'http://{{.HTTPIP}}:{{.HTTPPort}}/install{,-chroot}.sh'<enter><wait>",
"bash install.sh < install-chroot.sh && systemctl reboot<enter>"
]
}, {
"type": "qemu",
"boot_wait": "{{user `boot_wait`}}",
"http_directory": "http",
"disk_size": "{{user `disk_size`}}",
"iso_checksum_url": "{{user `iso_checksum_url`}}",
"iso_checksum_type": "{{user `iso_checksum_type`}}",
"iso_url": "{{user `iso_url`}}",
"ssh_username": "vagrant",
"ssh_password": "vagrant",
"ssh_port": 22,
"ssh_wait_timeout": "10000s",
"shutdown_command": "sudo systemctl poweroff",
"headless": "{{user `headless`}}",
"qemuargs": [
[
"-m",
"{{user `memory`}}"
],
[
"-smp",
"{{user `cpus`}}"
]
],
"boot_command": [
"<enter><wait10><wait10><wait10><wait10><wait10><enter><enter>",
"curl -O 'http://{{.HTTPIP}}:{{.HTTPPort}}/install{,-chroot}.sh'<enter><wait>",
"bash install.sh < install-chroot.sh && systemctl reboot<enter>"
]
}, {
"type": "vmware-iso",
"boot_wait": "{{user `boot_wait`}}",
"http_directory": "http",
"disk_size": "{{user `disk_size`}}",
"iso_checksum_url": "{{user `iso_checksum_url`}}",
"iso_checksum_type": "{{user `iso_checksum_type`}}",
"iso_url": "{{user `iso_url`}}",
"ssh_username": "vagrant",
"ssh_password": "vagrant",
"ssh_port": 22,
"ssh_wait_timeout": "10000s",
"shutdown_command": "sudo systemctl poweroff",
"headless": "{{user `headless`}}",
"memory": "{{user `memory`}}",
"cpus": "{{user `cpus`}}",
"boot_command": [
"<enter><wait10><wait10><wait10><wait10><wait10><enter><enter>",
"curl -O 'http://{{.HTTPIP}}:{{.HTTPPort}}/install{,-chroot}.sh'<enter><wait>",
"bash install.sh < install-chroot.sh && systemctl reboot<enter>"
]
}
],
"provisioners": [
{
"type": "shell",
"scripts": [
"provision/postinstall.sh",
"provision/virtualbox.sh",
"provision/cleanup.sh"
],
"execute_command": "echo 'vagrant'|sudo -S sh '{{.Path}}'",
"only": ["virtualbox-iso"]
},
{
"type": "shell",
"scripts": [
"provision/postinstall.sh",
"provision/qemu.sh",
"provision/cleanup.sh"
],
"execute_command": "echo 'vagrant'|sudo -S sh '{{.Path}}'",
"only": ["qemu"]
},
{
"type": "shell",
"scripts": [
"provision/postinstall.sh",
"provision/vmware.sh",
"provision/cleanup.sh"
],
"execute_command": "echo 'vagrant'|sudo -S sh '{{.Path}}'",
"only": ["vmware-iso"]
},
{
"type": "shell",
"scripts": [
"provision/write_zeroes.sh"
],
"execute_command": "if [ ! -z \"{{user `write_zeroes`}}\" ]; then echo 'vagrant'|sudo -S sh '{{.Path}}'; fi"
}
],
"post-processors": [
[
{
"type": "vagrant",
"keep_input_artifact": false,
"output": "Arch-Linux-x86_64-{{ .Provider }}-{{isotime \"2006-01-02\"}}.box"
}
]
]
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment