blob: 7b94f23d3462119dc51e081b2527db5fdcb4cfac [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 Casconeb7e618d2018-01-12 18:31:33 -080018# Wait for VM to power off
19sleep 10
20
21# Make sure VM is not running
Carmelo Casconed6615072017-12-15 00:53:43 -080022vagrant halt
23
24sleep 5
25
26# Remove vagrant shared folder
27vboxmanage sharedfolder remove ${VB_UUID} -name "vagrant"
28
29rm -rf onos-p4-dev.ova
30vboxmanage export ${VB_UUID} -o onos-p4-dev.ova