blob: 757f94b214acf8a573b1173f2bee87da398bce58 [file] [log] [blame]
Carmelo Casconed6615072017-12-15 00:53:43 -08001#!/usr/bin/env bash
2
3set -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.
7rm -rf .vagrant/
8
9vagrant up
10
11SSH_PORT=`vagrant port --guest 22`
12VB_UUID=`cat .vagrant/machines/default/virtualbox/id`
13
14sshpass -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 Casconed6615072017-12-15 00:53:43 -080018sleep 5
Carmelo Cascone4f985cd2018-02-11 17:36:42 -080019vboxmanage controlvm ${VB_UUID} acpipowerbutton
20
21# Wait for VM to power off
22sleep 30
Carmelo Casconed6615072017-12-15 00:53:43 -080023
24# Remove vagrant shared folder
25vboxmanage sharedfolder remove ${VB_UUID} -name "vagrant"
26
27rm -rf onos-p4-dev.ova
28vboxmanage export ${VB_UUID} -o onos-p4-dev.ova