Sha256: 8a2a3342ae0494dbe68e7465a755ada6434526562bcc7689438a46e8a78510e3

Contents?: true

Size: 1.09 KB

Versions: 5

Compression:

Stored size: 1.09 KB

Contents

namespace :airbrake do
  desc "Notify Airbrake of a new deploy."
  task :deploy => :environment do
    require 'airbrake_tasks'
    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
      heroku_api_key = `heroku console 'puts ENV[%{HOPTOAD_API_KEY}]' | head -n 1`.strip
      heroku_rails_env = `heroku console 'puts RAILS_ENV' | head -n 1`.strip

      command = %Q(heroku addons:add deployhooks:http url="http://airbrakeapp.com/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

5 entries across 5 versions & 1 rubygems

Version Path
airbrake-3.0.4 lib/airbrake/shared_tasks.rb
airbrake-3.0.3 lib/airbrake/shared_tasks.rb
airbrake-3.0.2 lib/airbrake/shared_tasks.rb
airbrake-3.0.1 lib/airbrake/shared_tasks.rb
airbrake-3.0 lib/airbrake/shared_tasks.rb