# This way you can customize which branches should be skipped when
# prepending commit message.
if [ -z "$BRANCHES_TO_SKIP" ]; then
BRANCHES_TO_SKIP=(master develop test)
BRANCH_NAME=$(git symbolic-ref --short HEAD)
View deploy.rb
raise 'Heroku application name argument is missing. (e.g. \'ruby lib/tasks/teamcity/heroku/deploy.rb elcurator-staging\')' unless HEROKU_APP
TEMP_DIFF_REMOTE = 'temp_diff_remote'
# Check if there is migrations to run
puts `git remote add #{TEMP_DIFF_REMOTE} #{HEROKU_GIT_URL}`
puts `git fetch #{TEMP_DIFF_REMOTE}`
there_is_migrations_to_run = !`git diff HEAD #{TEMP_DIFF_REMOTE}/master db/migrate`.empty?

Sizing your Rails application with Unicorn on Heroku

This tutorial assumes you are running a Rails application on Heroku with a Unicorn server. However, if you are not using one of those you will find some general information which can help you in your context.

This article will help you to correctly configure your Unicorn server based on real data.

I recommend you to use New Relic, which is really easy to setup with Rails & Heroku. It will help you monitoring your application and configure it at its best.

Using Unicorn Web Server


Rails mailer structure

Your application is growing, and you are starting to have a complex mailing system: notification emails, retention emails, misc user emails, admin emails, etc...

It's time to clean up your mailers !

Existing mailer

You may already have a single mailer, responsible of every emails, like this one:


Migrating an Heroku Application to another

The usecase here is to migrate an Heroku Application to Heroku Europe, and minimise downtime.

The heroku documentation on this subject is quite complete.
It is recommanded to read it if you are planning a migration.


In this guide, sourceapp is the original (source) app and targetapp is the migrated (target) app.