Created
October 3, 2012 18:28
-
-
Save keithcelt/3828826 to your computer and use it in GitHub Desktop.
ZSH 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 [[ -z "$1" ]] ; then | |
echo "We need a revision 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 [[ -z "$1" ]] ; then | |
echo "We need a revision to deploy. E.g. master" | |
return 1 | |
fi | |
i cap production deploy:migrations -s revision=$1 | |
} | |
tag() { | |
if [[ -z "$1" ]] ; 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