Carmelo Cascone | d661507 | 2017-12-15 00:53:43 -0800 | [diff] [blame] | 1 | #!/usr/bin/env bash |
| 2 | |
| 3 | set -xe |
| 4 | |
| 5 | # Remove references to the existing vagrant-built VM (if any). |
| 6 | # We want to build a new one from scratch, not start an existing one. |
| 7 | rm -rf .vagrant/ |
| 8 | |
| 9 | vagrant up |
| 10 | |
| 11 | SSH_PORT=`vagrant port --guest 22` |
| 12 | VB_UUID=`cat .vagrant/machines/default/virtualbox/id` |
| 13 | |
| 14 | sshpass -p 'rocks' \ |
| 15 | ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no \ |
| 16 | -p ${SSH_PORT} sdn@127.0.0.1 "bash /vagrant/pre-ova-cleanup.sh" |
| 17 | |
Carmelo Cascone | d661507 | 2017-12-15 00:53:43 -0800 | [diff] [blame] | 18 | sleep 5 |
Carmelo Cascone | 4f985cd | 2018-02-11 17:36:42 -0800 | [diff] [blame] | 19 | vboxmanage controlvm ${VB_UUID} acpipowerbutton |
| 20 | |
| 21 | # Wait for VM to power off |
| 22 | sleep 30 |
Carmelo Cascone | d661507 | 2017-12-15 00:53:43 -0800 | [diff] [blame] | 23 | |
| 24 | # Remove vagrant shared folder |
| 25 | vboxmanage sharedfolder remove ${VB_UUID} -name "vagrant" |
| 26 | |
| 27 | rm -rf onos-p4-dev.ova |
| 28 | vboxmanage export ${VB_UUID} -o onos-p4-dev.ova |