Sergio Slobodrian | be82927 | 2017-07-17 14:45:45 -0400 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | # This script is for developers only. It will create tunnels between |
| 4 | # the vm cluster and the installer's registry and between the voltha |
| 5 | # vm and the installer's registry. This allows containers to be |
| 6 | # pushed to the registry and pulled into the cluster allowing to rapidly |
| 7 | # cycle between container development and deployment for testing without |
| 8 | # having to re-build the entire installer and re-deploy the cluster. |
| 9 | |
| 10 | uid=`id -u` |
| 11 | iVmName="vInstaller${uid}" |
| 12 | vVmName="voltha_voltha${uid}" |
| 13 | volthaHome=~/cord/incubator/voltha |
| 14 | iIpAddr=`virsh domifaddr $iVmName | tail -n +3 | awk '{ print $4 }' | sed -e 's~/.*~~'` |
| 15 | vIpAddr=`virsh domifaddr $vVmName | tail -n +3 | awk '{ print $4 }' | sed -e 's~/.*~~'` |
| 16 | ssh -f -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i key.pem vinstall@$iIpAddr 'for i in .keys/*; do ssh -f -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o ServerAliveInterval=600 -o ServerAliveCountMax=9999 -R 5000:localhost:5000 -i $i voltha@`basename $i` sleep 5999400 ; done' |
| 17 | scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i ../.vagrant/machines/voltha${uid}/libvirt/private_key key.pem vagrant@$vIpAddr:. |
| 18 | ssh -f -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i ../.vagrant/machines/voltha${uid}/libvirt/private_key vagrant@$vIpAddr "ssh -f -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o ServerAliveInterval=600 -o ServerAliveCountMax=9999 -L 5000:localhost:5000 -i key.pem vinstall@${iIpAddr} sleep 5999400" |