Skip to content

Commit

Permalink
read every available parameter for deploy hook from ENV (airbrake#168)
Browse files Browse the repository at this point in the history
  • Loading branch information
shime committed Jan 20, 2013
1 parent f616190 commit 79d5770
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/airbrake/shared_tasks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,17 @@ def get_heroku_vars
heroku_rails_env = @heroku_vars["RAILS_ENV"] || ENV["RAILS_ENV"] || "production"
heroku_api_key = @heroku_vars["AIRBRAKE_API_KEY"] || Airbrake.configuration.api_key
heroku_app = ENV["HEROKU_APP"]
username = ENV["USER"]
revision = ENV["REVISION"]
repo = ENV["REPO"]

command = %Q(heroku addons:add deployhooks:http --url="http://airbrake.io/deploys.txt?api_key=#{heroku_api_key})
command << "&deploy[rails_env]=#{heroku_rails_env}" if heroku_rails_env
command << "&deploy[rails_env]=#{heroku_rails_env}" if heroku_rails_env
command << "&deploy[local_username]=#{username}" if username
command << "&deploy[scm_revision]=#{revision}" if revision
command << "&deploy[scm_repository]=#{repo}" if repo
command << '"'
command << " --app=#{heroku_app}" if heroku_app
command << " --app=#{heroku_app}" if heroku_app

puts "\nRunning:\n#{command}\n"
puts `#{command}`
Expand Down

0 comments on commit 79d5770

Please sign in to comment.