A quick heroku deployment tip
Deploying your application with Heroku is already pretty awesome. You just have to push to Heroku’s master branch, and the magic happens.
# Lets assume you set 'heroku' as origin
git push heroku master
That’s not much to type, but it could be even better. So I decided to create an alias:
# remember as heroku push
alias hp='git push heroku master'
Now you just have to type hp
. But the real goodness comes if you link this with the migration task.
# remember as heroku push migrate
alias hpm='git push heroku master && heroku run rake db:migrate'
Now you have two simple commands, hp
and hpm
, to deploy your app, or to deploy and migrate. I always use hpm
– with the positive side-effect that I can’t forget to migrate the database.
Just add these two lines to your .zsh_rc
file.
alias hp='git push heroku master'
alias hpm='git push heroku master && heroku run rake db:migrate'
I also recommend oh my zsh to enhance your ZSH shell. It comes with some nice aliases for git and other tools. For example gp
for git push
, gl
for git pull
, gst
for git status
, and so on.