Now, to make it even simpler, I've written a tiny little script, that lets me just do "script/deploy staging" or "script/deploy production". Another advantage of using a script is that I can do additional mundane overhead tasks in there. In this case, I turn Heroku's maintenance mode on before pushing, and off afterward.
#! /bin/shTo adapt it to your own site, simply adjust the APP and, if needed, BRANCH vars. (If you want to get fancier and deploy the master branch to the production remote and the develop branch to the staging remote, that's a whole 'nother story... but should be pretty trivial to code up.)
APP=codosaurus
BRANCH=master
SITE=$1
if [ -z "$SITE" ] ; then
echo "Must specify site (staging, production, etc.)"
exit 1
fi
heroku maintenance:on --app $APP-$SITE
git push $SITE $BRANCH
heroku maintenance:off --app $APP-$SITE
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.