diff --git a/tools/appliance/build.sh b/tools/appliance/build.sh index 736768af392..2cefd793c78 100755 --- a/tools/appliance/build.sh +++ b/tools/appliance/build.sh @@ -146,6 +146,9 @@ fi appliance_build_name=${appliance}${branch_tag}${version_tag} +# mac address of the vm we create +mac_address= + ### ### Generic helper functions ### @@ -308,6 +311,14 @@ function veewee_halt() { bundle exec veewee vbox halt "${appliance_build_name}" ${VEEWEE_ARGS} } +function save_mac_address() { + log INFO "saving new vm mac address" + mac_address=`vboxmanage showvminfo --details --machinereadable ${appliance_build_name} | grep macaddress1= | sed 's/macaddress1=//' | sed 's/"//g'` + if [ "${mac_address}" == "" ]; then + error "Could not find mac address for appliance ${appliance_build_name}" + fi +} + function check_appliance_shutdown() { log INFO "waiting for veewee appliance to shut down..." ! (vboxmanage list runningvms | grep "${appliance_build_name}") @@ -446,6 +457,32 @@ function vmware_export() { log INFO "${appliance} exported for VMWare: dist/${appliance_build_name}-vmware.ova" } +function vagrant_export() { + log INFO "creating vagrant export" + # this is based on veewee export logic, but, we don't want to use veewee export, + # since it makes optimistic assumptions about VM shutdown/halt leading to available + # disks and the like + disk="${appliance_build_name}-vmware.ovf" + mkdir -p "box/${appliance_build_name}" + cp "${disk}" "box/${appliance_build_name}/box.ovf" + cat >box/${appliance_build_name}/Vagrantfile <