Skip to content

@tylerhunt /deploy.sh
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Heroku Deploy Script
#!/bin/bash
args=`getopt r:m $*`
if [ $? != 0 ]; then
echo "Usage: $0 [-r heroku] [-m]"
exit 2
fi
set -- $args
for i; do
case "$i"
in
-r)
remote=$2
shift
;;
-m)
migrations=true
shift
;;
--)
shift
break
;;
esac
done
if [ -z "$remote" ]; then
remote="heroku"
fi
if [ -n "$migrations" ] ; then
echo "Deploying to $remote with migrations..."
sleep 2
heroku maintenance:on --remote $remote
git push $remote master
heroku run rake db:migrate --remote $remote
heroku restart --remote $remote
heroku maintenance:off --remote $remote
else
echo "Deploying to $remote..."
sleep 2
git push $remote master
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.