Software Developer and Founder Torsten Bühl

I am the founder of Company Signal, Exceptiontrap and Positron – SaaS products with a focus on simple usage and a beautiful user-interface. Learn more about them here. You can also find some articles about software development (especially Ruby related) below.


A quick heroku deployment tip

31 Oct 2013

Deploying your application with Heroku is already pretty awesome. You just have to push to Heroku's master branch.

# 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. Well, 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 now – 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 ships 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.