summaryrefslogtreecommitdiff
path: root/scripts/packer.json
diff options
context:
space:
mode:
authorYuya Kusakabe <yuya.kusakabe@gmail.com>2017-07-28 23:17:42 +0900
committerYuya Kusakabe <yuya.kusakabe@gmail.com>2017-07-29 01:34:49 +0900
commitbff1f61f47f228fbd8eae18586667779ccb27a31 (patch)
tree4ac0152a650e9b79333a4977d7787b18f6dd1414 /scripts/packer.json
parentec208d8eb6a3a746d1a1a5c361f6cdb5474fdd35 (diff)
downloadvyos-build-bff1f61f47f228fbd8eae18586667779ccb27a31.tar.gz
vyos-build-bff1f61f47f228fbd8eae18586667779ccb27a31.zip
Add script for building Vagrant libvirt box
Diffstat (limited to 'scripts/packer.json')
-rw-r--r--scripts/packer.json27
1 files changed, 25 insertions, 2 deletions
diff --git a/scripts/packer.json b/scripts/packer.json
index 83df10c5..39ab423b 100644
--- a/scripts/packer.json
+++ b/scripts/packer.json
@@ -2,7 +2,11 @@
"variables": {
"iso_url": "{{env `ISO_IMAGE`}}",
"iso_checksum": "{{env `ISO_MD5_SUM`}}",
- "output_directory": "{{env `PACKER_BUILD_DIR`}}"
+ "output_directory": "{{env `PACKER_BUILD_DIR`}}",
+ "box_tag": "{{env `VAGRANT_BOX_NAME`}}",
+ "cloud_token": "{{env `VAGRANT_CLOUD_ACCESS_TOKEN`}}",
+ "version": "{{env `VERSION`}}",
+ "box_base_url": "{{env `BOX_BASE_URL`}}"
},
"builders":
[
@@ -15,7 +19,7 @@
"output_directory": "{{user `output_directory`}}/qemu",
"shutdown_command": "sudo halt -p",
"disk_size": 4096,
- "format": "raw",
+ "format": "qcow2",
"headless": true,
"ssh_host_port_min": 2222,
"ssh_host_port_max": 2229,
@@ -90,5 +94,24 @@
"scripts/packer-scripts/vmware.sh"
]
}
+ ],
+ "post-processors": [
+ [
+ {
+ "type": "vagrant",
+ "only": ["qemu-image"],
+ "vagrantfile_template": "scripts/Vagrantfile",
+ "output": "{{user `output_directory`}}/vagrant-libvirt/vyos_vagrant_libvirt.box",
+ "keep_input_artifact": "true"
+ },
+ {
+ "type": "vagrant-cloud",
+ "only": ["qemu-image"],
+ "box_tag": "{{user `box_tag`}}",
+ "access_token": "{{user `cloud_token`}}",
+ "version": "{{user `version`}}",
+ "box_download_url": "{{user `box_base_url`}}/vyos-{{user `version`}}-vagrant-libvirt.box"
+ }
+ ]
]
}