Sergio Slobodrian | ee4b2bc | 2017-06-05 10:08:59 -0400 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | # This script is for development use. It copies all of the |
| 4 | # required files and directories to the installer VM to |
| 5 | # allow changes to be made without having to rebuild the |
| 6 | # VM and it's registry which is time consuming. |
| 7 | |
| 8 | # usage devCopyTiInstaller.sh <ip-address> |
| 9 | |
| 10 | |
| 11 | rm -f install.cfg |
| 12 | hosts="" |
| 13 | for i in `virsh list | awk '{print $2}' | grep ha-serv` |
| 14 | do |
| 15 | hosts="$hosts "`virsh domifaddr $i | tail -n +3 | head -n 1 | awk '{print $4}' | sed -e 's~/.*~~'` |
| 16 | done |
| 17 | echo "hosts=\"$hosts\"" >> install.cfg |
| 18 | |
| 19 | |
| 20 | ipAddr=`virsh domifaddr "Ubuntu1604LTS-1" | tail -n +3 | head -n 1 | awk '{print $4}' | sed -e 's~/.*~~'` |
| 21 | |
| 22 | ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i key.pem vinstall@$ipAddr rm -fr * |
| 23 | scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i key.pem installer.sh vinstall@$ipAddr:installer.sh |
| 24 | scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i key.pem install.cfg vinstall@$ipAddr:install.cfg |
| 25 | scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i key.pem -r ansible vinstall@$ipAddr:ansible |
| 26 | scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i key.pem -r ~/cord/incubator/voltha/compose vinstall@$ipAddr:compose |
| 27 | scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i key.pem -r ~/cord/incubator/voltha/nginx_config vinstall@$ipAddr:nginx_config |