From 2d12380ac99cc78bdb471f698391deb0e6a51d66 Mon Sep 17 00:00:00 2001 From: dsc Date: Mon, 9 Apr 2012 16:31:33 -0700 Subject: [PATCH] Reads various configuration variables from the env. --- deploy.sh | 14 ++++++++------ 1 files changed, 8 insertions(+), 6 deletions(-) diff --git a/deploy.sh b/deploy.sh index 908e0bb..1c626e2 100755 --- a/deploy.sh +++ b/deploy.sh @@ -7,13 +7,14 @@ set -e -VERBOSE=1 -DEPLOY_HOST=wmf@less.ly -DEPLOY_PATH=projects/kraken-ui/ +VERBOSE='-v' +KRAKEN_DEV_HOST="${KRAKEN_DEV_HOST:-localhost:8081}" +KRAKEN_DEPLOY_HOST="${KRAKEN_DEPLOY_HOST:-wmf@less.ly}" +KRAKEN_DEPLOY_PATH="${KRAKEN_DEPLOY_PATH:-projects/kraken-ui/}" # Utilities -log () { [ "$VERBOSE" ] && echo -e "$*" >&2; } +log () { [ "x$VERBOSE" != 'x' ] && echo -e "$*" >&2; } fail () { echo >&2; echo "Error: $*" >&2; exit 1; } count () { echo $#; } @@ -33,7 +34,7 @@ log "Collapsing serve trees..." rsync -Ca static/ var/ data tmp/dist/ rsync -Ca lib/ tmp/dist/src/ # browserify -o tmp/dist/vendor/browserify.js -r events -r seq -curl --silent --fail --url http://localhost:8081/vendor/browserify.js > tmp/dist/vendor/browserify.js +curl --silent --fail --url http://$KRAKEN_DEV_HOST/vendor/browserify.js > tmp/dist/vendor/browserify.js log "ok!" # Bundle Vendor JS Bundle @@ -69,7 +70,8 @@ log "ok!" # Finally, deploy the files log "Deploying files..." -rsync -Caz $([ "$VERBOSE" ] && echo '-v') --progress tmp/dist $DEPLOY_HOST:$DEPLOY_PATH +log "rsync -Caz $VERBOSE --progress tmp/dist $KRAKEN_DEPLOY_HOST:$KRAKEN_DEPLOY_PATH" +rsync -Caz $VERBOSE --progress tmp/dist $KRAKEN_DEPLOY_HOST:$KRAKEN_DEPLOY_PATH log "ok!" log "Done!" -- 1.7.0.4