Committed by
Gerrit Code Review
Adding onos-push-bits to selectively upload bits only if they are out of date. H…
…elps with speeds when running over VPN. Change-Id: I631ac84fb82a775195a472c28439bd5fd3f28e0e
Showing
2 changed files
with
20 additions
and
1 deletions
| ... | @@ -21,7 +21,7 @@ shift $OPC | ... | @@ -21,7 +21,7 @@ shift $OPC |
| 21 | node=${1:-$OCI} | 21 | node=${1:-$OCI} |
| 22 | remote=$ONOS_USER@$node | 22 | remote=$ONOS_USER@$node |
| 23 | 23 | ||
| 24 | -scp -q $ONOS_TAR $remote:/tmp | 24 | +$(dirname $0)/onos-push-bits $node |
| 25 | 25 | ||
| 26 | ssh $remote " | 26 | ssh $remote " |
| 27 | [ -d $ONOS_INSTALL_DIR/bin ] && echo \"ONOS is already installed\" && exit 1 | 27 | [ -d $ONOS_INSTALL_DIR/bin ] && echo \"ONOS is already installed\" && exit 1 | ... | ... |
tools/test/bin/onos-push-bits
0 → 100755
| 1 | +#!/bin/bash | ||
| 2 | +# ----------------------------------------------------------------------------- | ||
| 3 | +# Remotely pushes bits to a remote node 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 | +node=${1:-$OCI} | ||
| 10 | +remote=$ONOS_USER@$node | ||
| 11 | + | ||
| 12 | +locHash=$(cksum $ONOS_TAR | cut -d' ' -f1,2) | ||
| 13 | +remHash=$(ssh $remote cksum $ONOS_TAR | cut -d' ' -f1,2) | ||
| 14 | + | ||
| 15 | +if [ "$locHash" = "$remHash" ]; then | ||
| 16 | + echo "ONOS bits $ONOS_TAR already up-to-date on $node..." | ||
| 17 | +else | ||
| 18 | + scp -q $ONOS_TAR $remote:/tmp | ||
| 19 | +fi |
-
Please register or login to post a comment