Thomas Vachuska | a132e3a | 2015-02-21 01:53:14 -0800 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # ----------------------------------------------------------------------------- |
| 3 | # Remotely pushes 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 | |
Thomas Vachuska | 4a9d63e | 2015-05-21 12:15:36 -0700 | [diff] [blame] | 9 | OCT=${OCT:-$OCI} |
Thomas Vachuska | a132e3a | 2015-02-21 01:53:14 -0800 | [diff] [blame] | 10 | node=${1:-$OCT} |
| 11 | remote=$ONOS_USER@$node |
| 12 | shift |
| 13 | |
| 14 | echo "Pushing to proxy $node..." |
| 15 | onos-push-bits $node |
| 16 | |
Claudine Chiu | 45312d0 | 2016-06-15 13:17:12 +0000 | [diff] [blame] | 17 | others=$(env | sort | egrep "^OC[0-9]+" | cut -d= -f2 | grep -vE "^$OCT\$") |
Thomas Vachuska | a132e3a | 2015-02-21 01:53:14 -0800 | [diff] [blame] | 18 | |
Yuta HIGUCHI | 3dcd286 | 2017-02-02 15:22:12 -0800 | [diff] [blame] | 19 | ssh $remote " |
| 20 | for other in ${others//$'\n'/ } ; do |
| 21 | echo \"Pushing to \$other ...\"; |
Brian O'Connor | c5c8840 | 2017-08-15 17:02:32 -0700 | [diff] [blame] | 22 | scp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \ |
| 23 | /tmp/\$(basename $ONOS_TAR) \ |
DongRyeol Cha | 5c0a9f0 | 2018-05-17 14:32:55 +0900 | [diff] [blame^] | 24 | $ONOS_USER@[\$other]:/tmp/\$(basename $ONOS_TAR) |
Yuta HIGUCHI | 3dcd286 | 2017-02-02 15:22:12 -0800 | [diff] [blame] | 25 | done |
| 26 | " |