Created
May 9, 2012 09:48
-
-
Save marten/2643430 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace :notify do | |
task :airbrake do | |
# We need to do this require here, becaure Airbrake will load up ActiveSupport, | |
# which will set up Kernel#capture, which will fudge up capistrano's capture method. | |
# If we do the require here (just-in-time) and just HOPE that nobody after | |
# us needs capture, we might be ok. | |
# | |
# Yeah, really. | |
require 'airbrake' | |
require 'airbrake_tasks' | |
# Airbrake needs its API key, which is in the initializer | |
load "config/initializers/airbrake.rb" | |
logger.info "Notifying Airbrake of Deploy" | |
if dry_run | |
logger.info "DRY RUN: Notification not actually run." | |
else | |
AirbrakeTasks.deploy(:rails_env => fetch(:airbrake_env, fetch(:rails_env, "production")), | |
:scm_revision => current_revision, | |
:scm_repository => repository, | |
:local_username => ENV['USER'] || ENV['USERNAME']) | |
end | |
logger.info "Airbrake Notification Complete." | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment