From 9d6ba00115a492d178679b042e648ae0db93dc5d Mon Sep 17 00:00:00 2001 From: Francesco Siddi Date: Mon, 22 Aug 2016 23:15:37 +0200 Subject: [PATCH] Introducing rsync.ui --- rsync_ui.sh | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 rsync_ui.sh diff --git a/rsync_ui.sh b/rsync_ui.sh new file mode 100755 index 0000000..9e1b074 --- /dev/null +++ b/rsync_ui.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env bash + +: ${PILLAR_DIR?"Need to set PILLAR_DIR"} + +ASSETS="$PILLAR_DIR/pillar/web/static/assets/" +TEMPLATES="$PILLAR_DIR/pillar/web/templates/" + +cd $PILLAR_DIR +if [ $(git rev-parse --abbrev-ref HEAD) != "production" ]; then + echo "You are NOT on the production branch, refusing to rsync_ui." >&2 + exit 1 +fi + +echo +echo "*** GULPA GULPA ***" +if [ -x ./node_modules/.bin/gulp ]; then + ./node_modules/.bin/gulp --production +else + gulp --production +fi + +echo +echo "*** SYNCING ASSETS ***" +rsync -avh $ASSETS root@cloud.blender.org:/data/git/pillar/pillar/web/static/assets/ + +echo +echo "*** SYNCING TEMPLATES ***" +rsync -avh $TEMPLATES root@cloud.blender.org:/data/git/pillar/pillar/web/templates/