blob: 07b8ed6ace110060247589f16c6ca03f18eb213c [file] [log] [blame]
Sergio Slobodrian7c5e8852017-07-31 20:17:14 -04001#!/bin/bash
Zack Williams41513bf2018-07-07 20:08:35 -07002# 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 Slobodrian7c5e8852017-07-31 20:17:14 -040015
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
20cont=$1
21uid=`id -u`
22iVmName="vInstaller${uid}"
23vVmName="voltha_voltha${uid}"
24volthaHome=~/cord/incubator/voltha
25iIpAddr=`virsh domifaddr $iVmName | tail -n +3 | awk '{ print $4 }' | sed -e 's~/.*~~'`
26vIpAddr=`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
30pushd ~/cord/incubator/voltha
31vagrant rsync
32popd
33pushd ~/cord/incubator/voltha/install
34# Build each of the specified targets
35for i in $@
36do
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"
38done
39popd