Jordan Halterman | 6b38425 | 2018-10-26 19:13:25 -0700 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # ----------------------------------------------------------------------------- |
| 3 | # Remotely pushes Atomix bits to all remote nodes in preparation for install. |
| 4 | # ----------------------------------------------------------------------------- |
| 5 | |
| 6 | [ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1 |
| 7 | . $ONOS_ROOT/tools/build/envDefaults |
| 8 | |
| 9 | OCT=${OCT:-$OCI} |
| 10 | node=${1:-$OCT} |
| 11 | remote=$ONOS_USER@$node |
| 12 | shift |
| 13 | |
| 14 | echo "Pushing to proxy $node..." |
| 15 | atomix-push-bits $node |
| 16 | |
| 17 | others=$(env | sort | egrep "^OCC[0-9]+" | cut -d= -f2 | grep -vE "^$OCT\$") |
| 18 | |
| 19 | ssh $remote " |
| 20 | for other in ${others//$'\n'/ } ; do |
| 21 | echo \"Pushing to \$other ...\"; |
| 22 | ssh -o StrictHostKeyChecking=no $ONOS_USER@\$other rm -rf /tmp/atomix.tar.gz && |
| 23 | scp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \ |
| 24 | /tmp/atomix.tar.gz \ |
| 25 | $ONOS_USER@[\$other]:/tmp/atomix.tar.gz |
| 26 | done |
| 27 | " |