blob: cf6ddb8dc80449e747bcb95fe065248537fb6bf9 [file] [log] [blame]
Sergio Slobodrian7c5e8852017-07-31 20:17:14 -04001#!/bin/bash
2
3# This script is for developers only. It will sync the local filesystem
4# to the voltha vm and then rebuild each of the targets specified on the
5# command line.
6
7cont=$1
8uid=`id -u`
9iVmName="vInstaller${uid}"
10vVmName="voltha_voltha${uid}"
11volthaHome=~/cord/incubator/voltha
12iIpAddr=`virsh domifaddr $iVmName | tail -n +3 | awk '{ print $4 }' | sed -e 's~/.*~~'`
13vIpAddr=`virsh domifaddr $vVmName | tail -n +3 | awk '{ print $4 }' | sed -e 's~/.*~~'`
14
15# TODO: Validate the command line and print a help message
16
17pushd ~/cord/incubator/voltha
18vagrant rsync
19popd
20pushd ~/cord/incubator/voltha/install
21# Build each of the specified targets
22for i in $@
23do
24 ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i ../.vagrant/machines/voltha${uid}/libvirt/private_key vagrant@$vIpAddr "cd /cord/incubator/voltha && source env.sh && make $i"
25done
26popd