lib/honeybadger/capistrano.rb in honeybadger-1.6.2 vs lib/honeybadger/capistrano.rb in honeybadger-1.7.0
- old
+ new
@@ -17,19 +17,23 @@
rails_env = fetch(:rails_env, "production")
honeybadger_env = fetch(:honeybadger_env, fetch(:rails_env, "production"))
rake_task = fetch(:honeybadger_deploy_task, 'honeybadger:deploy')
local_user = ENV['USER'] || ENV['USERNAME']
executable = RUBY_PLATFORM.downcase.include?('mswin') ? fetch(:rake, 'rake.bat') : fetch(:rake, 'rake')
+ async_notify = fetch(:honeybadger_async_notify, false)
directory = configuration.current_release
- notify_command = "cd #{directory}; #{executable} RAILS_ENV=#{rails_env} #{rake_task} TO=#{honeybadger_env} REVISION=#{current_revision} REPO=#{repository} USER=#{local_user}"
+ notify_command = "cd #{directory};"
+ notify_command << " nohup" if async_notify
+ notify_command << " #{executable} RAILS_ENV=#{rails_env} #{rake_task} TO=#{honeybadger_env} REVISION=#{current_revision} REPO=#{repository} USER=#{local_user}"
notify_command << " DRY_RUN=true" if dry_run
notify_command << " API_KEY=#{ENV['API_KEY']}" if ENV['API_KEY']
+ notify_command << " >> /dev/null 2>&1 &" if async_notify
logger.info "Notifying Honeybadger of Deploy (#{notify_command})"
if configuration.dry_run
logger.info "DRY RUN: Notification not actually run."
else
result = ""
- run(notify_command, :once => true) { |ch, stream, data| result << data }
+ run(notify_command, :once => true, :pty => false) { |ch, stream, data| result << data }
# TODO: Check if SSL is active on account via result content.
end
logger.info "Honeybadger Notification Complete."
end
end