Capistrano
Report deploys to Rollbar from Capistrano
Capistrano 3
Add to your Gemfile
:
gem 'rollbar', '~>2.0'
Add to your Capfile
:
require 'rollbar/capistrano3'
Add to your deploy.rb
:
set :rollbar_token, 'POST_SERVER_ITEM_ACCESS_TOKEN'
set :rollbar_env, Proc.new { fetch :stage }
set :rollbar_role, Proc.new { :app }
NOTE: We've seen problems with Capistrano version `3.0.x` where the revision reported is incorrect. Version `3.1.0` and higher works correctly.
Capistrano 2
Add to your Gemfile:
gem 'rollbar', '~>2.0'
Add to your deploy.rb
:
require 'rollbar/capistrano'
set :rollbar_token, 'POST_SERVER_ITEM_ACCESS_TOKEN'
Available options:
-
rollbar_token
The same project access token as you used for therails generate rollbar
command; find it inconfig/initializers/rollbar.rb
. (It's repeated here for performance reasons, so the rails environment doesn't have to be initialized.) -
rollbar_env
Deploy environment name. Default:rails_env
Capistrano Multistage
For capistrano/multistage
, try:
set(:rollbar_env) { stage }
Updated 9 months ago