From ce00665cb25fc781841ef57e93cf10a9563a3e70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Fri, 10 Mar 2017 09:52:58 +0100 Subject: [PATCH] Updated rsync_ui to deploy to different hosts --- rsync_ui.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/rsync_ui.sh b/rsync_ui.sh index c6bf2b6..f1e9fce 100755 --- a/rsync_ui.sh +++ b/rsync_ui.sh @@ -2,6 +2,13 @@ set -e # error out when one of the commands in the script errors. +if [ -z "$1" ]; then + echo "Usage: $0 {host-to-deploy-to}" >&2 + exit 1 +fi + +DEPLOYHOST="$1" + # macOS does not support readlink -f, so we use greadlink instead if [[ `uname` == 'Darwin' ]]; then command -v greadlink 2>/dev/null 2>&1 || { echo >&2 "Install greadlink using brew."; exit 1; } @@ -37,8 +44,8 @@ echo "*** GULPA GULPA ***" echo echo "*** SYNCING ASSETS ***" # Exclude files managed by Git. -rsync -avh $ASSETS --exclude js/vendor/ root@cloud.blender.org:/data/git/attract/attract/static/assets/ +rsync -avh $ASSETS --exclude js/vendor/ root@${DEPLOYHOST}:/data/git/attract/attract/static/assets/ echo echo "*** SYNCING TEMPLATES ***" -rsync -avh $TEMPLATES root@cloud.blender.org:/data/git/attract/attract/templates/ +rsync -avh $TEMPLATES root@${DEPLOYHOST}:/data/git/attract/attract/templates/