Adding deploy hooks to Heroku

Adding deployment hooks to your Heroku app.


Add the bugsnag-capistrano Ruby gem to your Gemfile:

gem 'bugsnag-capistrano'

Don’t forget to run bundle install after updating your Gemfile.


Require bugsnag-capistrano/tasks in your Rakefile:

require 'bugsnag-capistrano/tasks'

Set the BUGSNAG_API_KEY environment variable with your project’s API key.

Adding the deploy hook to Heroku

Add the Bugsnag deploy tracking hook to your Heroku application by running the following command from your application’s directory:

$ bundle exec rake bugsnag:heroku:add_deploy_hook

If you have multiple Heroku apps, you can specify which app to add the hook for as with the HEROKU_APP environment variable:

$ bundle exec rake bugsnag:heroku:add_deploy_hook HEROKU_APP=my-app

Configuration options

You can set the following environmental variables to override or specify additional deploy information:

Variable Description
BUGSNAG_API_KEY Your Bugsnag API key (required)
BUGSNAG_RELEASE_STAGE The release stage (eg, production, staging) currently being deployed.
BUGSNAG_REPOSITORY The repository from which you are deploying the code.
BUGSNAG_BRANCH The source control branch from which you are deploying the code.
BUGSNAG_REVISION The source control revision for the code you are currently deploying.
BUGSNAG_APP_VERSION The app version of the code you are currently deploying.