dotfiles/bin/cf_prepare_for_push

36 lines
499 B
Text
Raw Normal View History

2014-06-26 00:12:52 -07:00
#!/bin/bash
set -e
usage() {
echo "$0 <deploy-branch-name>"
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 $@