From 6d3457b79dde5a49850f9f38a5ebb23500835858 Mon Sep 17 00:00:00 2001 From: Michael Marchetti Date: Wed, 11 Jul 2018 20:28:44 +0200 Subject: [PATCH] Add build_dir variable for build Change-Id: Ia65ade3e0336e7eddfd250b4c4d74a3a7d1d3c41 Signed-off-by: Michael Marchetti --- packer/ubuntu1604-juju.json | 9 ++++++--- packer/ubuntu1604-ovf-osm.json | 5 +++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/packer/ubuntu1604-juju.json b/packer/ubuntu1604-juju.json index 15db3121..8263eef6 100644 --- a/packer/ubuntu1604-juju.json +++ b/packer/ubuntu1604-juju.json @@ -34,6 +34,9 @@ "script": "scripts/cleanup.sh" } ], + "variables": { + "build_dir": "jujubase-{{timestamp}}" + }, "builders": [ { "type": "virtualbox-iso", @@ -64,7 +67,7 @@ "" ], "boot_wait": "10s", - "disk_size": 20480, + "disk_size": 40000, "guest_os_type": "Ubuntu_64", "headless": true, "http_directory": "http", @@ -81,7 +84,7 @@ "shutdown_command": "echo 'vagrant'|sudo -S shutdown -P now", "guest_additions_path": "VBoxGuestAdditions_{{.Version}}.iso", "virtualbox_version_file": ".vbox_version", - "output_directory": "jujubase-{{timestamp}}", + "output_directory": "{{user `build_dir`}}", "vm_name": "xenial-jujubase", "vboxmanage": [ [ @@ -101,7 +104,7 @@ ], "post-processors": [ { - "output": "jujubase-{{timestamp}}/{{.Provider}}-jujubase.box", + "output": "{{user `build_dir`}}/{{.Provider}}-jujubase.box", "type": "vagrant", "keep_input_artifact": true } diff --git a/packer/ubuntu1604-ovf-osm.json b/packer/ubuntu1604-ovf-osm.json index d4a2c776..5e0e81a3 100644 --- a/packer/ubuntu1604-ovf-osm.json +++ b/packer/ubuntu1604-ovf-osm.json @@ -20,6 +20,7 @@ "osm_install_options": "--vimemu", "input_ovf": "output-virtualbox-iso/packer-ubuntu-16.04-amd64-juju.ovf", "vm_name": "xenial-osm" + "build_dir": "osm-{{timestamp}}" }, "builders": [ { @@ -33,7 +34,7 @@ "shutdown_command": "echo 'vagrant'|sudo -S shutdown -P now", "virtualbox_version_file": ".vbox_version", "vm_name": "{{user `vm_name`}}", - "output_directory": "osm-{{timestamp}}", + "output_directory": "{{user `build_dir`}}", "vboxmanage": [ [ "modifyvm", @@ -53,7 +54,7 @@ "post-processors": [ [ { - "output": "osm-{{timestamp}}/{{.Provider}}-osm.box", + "output": "{{user `build_dir`}}/{{.Provider}}-osm.box", "type": "vagrant", "keep_input_artifact": true }, -- 2.25.1