Sha256: 863d206edc3ec280b1e15f5a5f68cbcc02360bb2df8e8afa61bd30de768fa5af
Contents?: true
Size: 1.45 KB
Versions: 3
Compression:
Stored size: 1.45 KB
Contents
namespace :airbrake do desc "Notify Airbrake of a new deploy." task :deploy do require 'airbrake_tasks' 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'], :local_username => ENV['USER'], :api_key => ENV['API_KEY'], :dry_run => ENV['DRY_RUN']) end task :log_stdout do require 'logger' RAILS_DEFAULT_LOGGER = Logger.new(STDOUT) end namespace :heroku do desc "Install Heroku deploy notifications addon" task :add_deploy_notification => [:environment] do def heroku_var(var) `heroku config | grep -E "#{var.upcase}" | awk '{ print $3; }'`.strip end heroku_rails_env = heroku_var("rails_env") heroku_api_key = heroku_var("(hoptoad|airbrake)_api_key").split.find {|x| x unless x.blank?} || Airbrake.configuration.api_key command = %Q(heroku addons:add deployhooks:http --url="http://airbrake.io/deploys.txt?deploy[rails_env]=#{heroku_rails_env}&api_key=#{heroku_api_key}") puts "\nRunning:\n#{command}\n" puts `#{command}` end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
airbrake-3.1.6 | lib/airbrake/shared_tasks.rb |
airbrake-3.1.5 | lib/airbrake/shared_tasks.rb |
airbrake-3.1.4 | lib/airbrake/shared_tasks.rb |