diff --git a/deploy.sh b/deploy.sh index 8f5758f..efa8200 100755 --- a/deploy.sh +++ b/deploy.sh @@ -1,11 +1,23 @@ #!/bin/bash -e +case $1 in + production) + DEPLOYHOST="cloud.blender.org" + ;; + staging) + DEPLOYHOST="cloud2" + ;; + *) + echo "Use $0 cloud|staging" >&2 + exit 1 +esac + # Deploys the current production branch to the production machine. PROJECT_NAME="blender-cloud" DOCKER_NAME="blender_cloud" REMOTE_ROOT="/data/git/${PROJECT_NAME}" -SSH="ssh -o ClearAllForwardings=yes cloud.blender.org" +SSH="ssh -o ClearAllForwardings=yes ${DEPLOYHOST}" # macOS does not support readlink -f, so we use greadlink instead if [[ `uname` == 'Darwin' ]]; then @@ -91,9 +103,9 @@ git_pull blender-cloud production #${SSH} -t docker exec ${DOCKER_NAME} /data/venv/bin/pip install -U -r ${REMOTE_ROOT}/requirements.txt --exists-action w # RSync the world -$ATTRACT_DIR/rsync_ui.sh -$FLAMENCO_DIR/rsync_ui.sh -./rsync_ui.sh +$ATTRACT_DIR/rsync_ui.sh ${DEPLOYHOST} +$FLAMENCO_DIR/rsync_ui.sh ${DEPLOYHOST} +./rsync_ui.sh ${DEPLOYHOST} # Notify Bugsnag of this new deploy. echo diff --git a/rsync_ui.sh b/rsync_ui.sh index 50c0cd5..2c4aed1 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" + PILLAR_DIR=$(python <