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 | |
| 18 | vagrant halt |
| 19 | |
| 20 | sleep 5 |
| 21 | |
| 22 | # Remove vagrant shared folder |
| 23 | vboxmanage sharedfolder remove ${VB_UUID} -name "vagrant" |
| 24 | |
| 25 | rm -rf onos-p4-dev.ova |
| 26 | vboxmanage export ${VB_UUID} -o onos-p4-dev.ova |