Sergio Slobodrian | 7c5e885 | 2017-07-31 20:17:14 -0400 | [diff] [blame] | 1 | #!/bin/bash |
Zack Williams | 41513bf | 2018-07-07 20:08:35 -0700 | [diff] [blame] | 2 | # Copyright 2017-present Open Networking Foundation |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
Sergio Slobodrian | 7c5e885 | 2017-07-31 20:17:14 -0400 | [diff] [blame] | 15 | |
| 16 | # This script is for developers only. It will sync the local filesystem |
| 17 | # to the voltha vm and then rebuild each of the targets specified on the |
| 18 | # command line. |
| 19 | |
| 20 | cont=$1 |
| 21 | uid=`id -u` |
| 22 | iVmName="vInstaller${uid}" |
| 23 | vVmName="voltha_voltha${uid}" |
| 24 | volthaHome=~/cord/incubator/voltha |
| 25 | iIpAddr=`virsh domifaddr $iVmName | tail -n +3 | awk '{ print $4 }' | sed -e 's~/.*~~'` |
| 26 | vIpAddr=`virsh domifaddr $vVmName | tail -n +3 | awk '{ print $4 }' | sed -e 's~/.*~~'` |
| 27 | |
| 28 | # TODO: Validate the command line and print a help message |
| 29 | |
| 30 | pushd ~/cord/incubator/voltha |
| 31 | vagrant rsync |
| 32 | popd |
| 33 | pushd ~/cord/incubator/voltha/install |
| 34 | # Build each of the specified targets |
| 35 | for i in $@ |
| 36 | do |
| 37 | 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" |
| 38 | done |
| 39 | popd |