Sergio Slobodrian | 7c5e885 | 2017-07-31 20:17:14 -0400 | [diff] [blame] | 1 | #!/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 | |
| 7 | cont=$1 |
| 8 | uid=`id -u` |
| 9 | iVmName="vInstaller${uid}" |
| 10 | vVmName="voltha_voltha${uid}" |
| 11 | volthaHome=~/cord/incubator/voltha |
| 12 | iIpAddr=`virsh domifaddr $iVmName | tail -n +3 | awk '{ print $4 }' | sed -e 's~/.*~~'` |
| 13 | vIpAddr=`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 | |
| 17 | pushd ~/cord/incubator/voltha |
| 18 | vagrant rsync |
| 19 | popd |
| 20 | pushd ~/cord/incubator/voltha/install |
| 21 | # Build each of the specified targets |
| 22 | for i in $@ |
| 23 | do |
| 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" |
| 25 | done |
| 26 | popd |