#!/bin/bash set -e usage() { echo "$0 " exit 1 } main() { if [ -z "$TESTING" ]; then CHANNEL="platform" else CHANNEL="haaktest" fi USERNAME=$USER DEPLOY_BRANCH="$1" if [ -z $DEPLOY_BRANCH ]; then usage fi nodebot $CHANNEL "push starting; ping $USERNAME with branch name if you want in." setup_deploy_branch "$DEPLOY_BRANCH" } setup_deploy_branch() { DEPLOY_BRANCH_NAME=$1 git fetch origin git checkout -b $DEPLOY_BRANCH_NAME origin/master } main $@