Skip to content

Instantly share code, notes, and snippets.

@keithcelt
Created October 3, 2012 20:46
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save keithcelt/3829745 to your computer and use it in GitHub Desktop.
Save keithcelt/3829745 to your computer and use it in GitHub Desktop.
Bash scripts for GSE
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