This repository has been archived on 2020-01-20. You can view files and clone it, but cannot push or open issues or pull requests.
node-spearhead/tools/rsync-to
2014-02-07 13:21:24 -08:00

25 lines
553 B
Bash
Executable File

#!/bin/bash
#
# Rsync the master in this working copy to the install on the given HN.
#
#set -o xtrace
set -o errexit
TOP=$(cd $(dirname $0)/../; pwd)
NODE=$1
[[ -z "$NODE" ]] && echo 'rsync-to: error: no headnode given' && exit 1
BASEDIR=/opt/smartdc/sdcadm
extraOpts=
if [[ $(uname -s) != "SunOS" ]]; then
extraOpts="--exclude *.node --exclude build"
else
# Clean node_modules everytime.
ssh $NODE rm -rf $BASEDIR/node_modules
fi
for f in bin lib node_modules package.json; do
rsync -av ${TOP}/$f $NODE:$BASEDIR/$f $extraOpts
done