blob: 978174b8ccfef74e40a04e3984e602782f5f0828 [file] [log] [blame]
Thomas Vachuskaa132e3a2015-02-21 01:53:14 -08001#!/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 Vachuska4a9d63e2015-05-21 12:15:36 -07009OCT=${OCT:-$OCI}
Thomas Vachuskaa132e3a2015-02-21 01:53:14 -080010node=${1:-$OCT}
11remote=$ONOS_USER@$node
12shift
13
14echo "Pushing to proxy $node..."
15onos-push-bits $node
16
Claudine Chiu45312d02016-06-15 13:17:12 +000017others=$(env | sort | egrep "^OC[0-9]+" | cut -d= -f2 | grep -vE "^$OCT\$")
Thomas Vachuskaa132e3a2015-02-21 01:53:14 -080018
Yuta HIGUCHI3dcd2862017-02-02 15:22:12 -080019ssh $remote "
20 for other in ${others//$'\n'/ } ; do
21 echo \"Pushing to \$other ...\";
Ray Milkey39332952018-07-16 13:42:51 -070022 ssh -o StrictHostKeyChecking=no $ONOS_USER@\$other rm -rf /tmp/\$(basename $ONOS_TAR) &&
Brian O'Connorc5c88402017-08-15 17:02:32 -070023 scp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \
24 /tmp/\$(basename $ONOS_TAR) \
DongRyeol Cha5c0a9f02018-05-17 14:32:55 +090025 $ONOS_USER@[\$other]:/tmp/\$(basename $ONOS_TAR)
Yuta HIGUCHI3dcd2862017-02-02 15:22:12 -080026 done
27"