Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fallback to loading whole environment if initializer does not exist

  • Loading branch information...
commit fff8cf8c350e691b615778f50c08e8e3f77425a9 1 parent f04686d
@exviva exviva authored
Showing with 11 additions and 1 deletion.
  1. +11 −1 lib/airbrake/shared_tasks.rb
View
12 lib/airbrake/shared_tasks.rb
@@ -2,7 +2,17 @@
desc "Notify Airbrake of a new deploy."
task :deploy do
require 'airbrake_tasks'
- load File.join(Rails.root, 'config', 'initializers','airbrake.rb') if defined?(Rails.root)
+
+ if defined?(Rails.root)
+ initializer_file = Rails.root.join('config', 'initializers','airbrake.rb')
+
+ if initializer_file.exist?
+ load initializer_file
+ else
+ Rake::Task[:environment].invoke
+ end
+ end
+
AirbrakeTasks.deploy(:rails_env => ENV['TO'],
:scm_revision => ENV['REVISION'],
:scm_repository => ENV['REPO'],
Please sign in to comment.
Something went wrong with that request. Please try again.