Sha256: 07f63e8eedec460348c7b9ce9d9f5c29a60aa081221d4a354c6e6e1f1d7bfcec

Contents?: true

Size: 1.03 KB

Versions: 9

Compression:

Stored size: 1.03 KB

Contents

namespace :hoptoad do
  desc "Notify Hoptoad of a new deploy."
  task :deploy => :environment do
    require 'hoptoad_tasks'
    HoptoadTasks.deploy(:rails_env      => ENV['TO'],
                        :scm_revision   => ENV['REVISION'],
                        :scm_repository => ENV['REPO'],
                        :local_username => ENV['USER'],
                        :api_key        => ENV['API_KEY'])
  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://hoptoadapp.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

9 entries across 9 versions & 2 rubygems

Version Path
hoptoad_notifier-2.4.9 lib/hoptoad_notifier/shared_tasks.rb
square-hoptoad_notifier-2.4.8 lib/hoptoad_notifier/shared_tasks.rb
hoptoad_notifier-2.4.8 lib/hoptoad_notifier/shared_tasks.rb
hoptoad_notifier-2.4.7 lib/hoptoad_notifier/shared_tasks.rb
hoptoad_notifier-2.4.6 lib/hoptoad_notifier/shared_tasks.rb
hoptoad_notifier-2.4.5 lib/hoptoad_notifier/shared_tasks.rb
hoptoad_notifier-2.4.4 lib/hoptoad_notifier/shared_tasks.rb
hoptoad_notifier-2.4.2 lib/hoptoad_notifier/shared_tasks.rb
hoptoad_notifier-2.4.1 lib/hoptoad_notifier/shared_tasks.rb