Deploying with Rake

Notify BugSnag of deploys using Rake.

Installation

Add the bugsnag-capistrano Ruby gem to your Gemfile:

gem 'bugsnag-capistrano'

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

Configuration

Require bugsnag-capistrano/tasks in your Rakefile:

require 'bugsnag-capistrano/tasks'

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

Notifying of deployments

Use the bugsnag:deploy task to send deployments to BugSnag.

rake bugsnag:deploy BUGSNAG_RELEASE_STAGE=production \
                    BUGSNAG_APP_VERSION=1.0.2

Configuration options

All configuration options are available as environment variables, or are set automatically if BugSnag has already been configured and will run before the task.

Environment variable Description
BUGSNAG_API_KEY Your BugSnag API key (required)
BUGSNAG_APP_VERSION The app version of the code being deployed
BUGSNAG_BRANCH The source control branch the code is being deployed from
BUGSNAG_RELEASE_STAGE The release stage (e.g. production, staging)
BUGSNAG_REVISION The source control revision of the deploying code
BUGSNAG_REPOSITORY The repository URL the code is being deployed from