Created
October 3, 2012 20:46
-
-
Save keithcelt/3829745 to your computer and use it in GitHub Desktop.
Bash scripts for GSE
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
i() { | |
if [[ -s tmp/isolate ]] ; then | |
echo "\$ rake isolate:sh['$*']" | |
rake isolate:sh\["$*"\] | |
else | |
echo "\$ bundle exec $*" | |
bundle exec $* | |
fi | |
afplay /System/Library/Sounds/Hero.aiff | |
} | |
stage() { | |
CWD=`pwd` | |
DIR=${CWD##*/} | |
if [ "$*" == "" ]; then | |
echo "We need a branch to deploy. E.g. master" | |
return 1 | |
fi | |
if [[ $DIR == "goldstar" ]] ; then | |
i cap rails3_staging deploy:migrations -s revision=$1 | |
fi | |
if [[ $DIR == "fulfillment" ]] ; then | |
i cap staging deploy:migrations -s revision=$1 | |
fi | |
} | |
deploy() { | |
if [ "$*" == "" ]; then | |
echo "We need a branch to deploy. E.g. master" | |
return 1 | |
fi | |
i cap production deploy:migrations -s revision=$1 | |
} | |
tag() { | |
if [ "$*" == "" ]; then | |
echo "We need a name for this tag. E.g. 2012123101" | |
return 1 | |
fi | |
echo "Tagging release release-$1" | |
echo "Stashing any pending changes" | |
git stash | |
echo "Discarding any remaining changes" | |
git checkout . | |
echo "\$ git checkout master" | |
git checkout master | |
echo "\$ git pull" | |
git pull | |
echo "\$ git tag $1" | |
git tag release-$1 | |
echo "\$ git push origin release-$1" | |
git push origin release-$1 | |
echo "release-$1 tagged and ready for deploy" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment