Permalink
Browse files

automatically get remote origin for deploy hooks (#168)

  • Loading branch information...
1 parent 241ecf9 commit dbc50e54a86084a829140b7e2dbcc0052ff4b15d @shime shime committed Jan 21, 2013
Showing with 2 additions and 2 deletions.
  1. +1 −1 README_FOR_HEROKU_ADDON.md
  2. +1 −1 lib/airbrake/shared_tasks.rb
@@ -97,6 +97,6 @@ You can pass in additional information for the deploy hook, in the ENV. Here are
* `ENV["RAILS_ENV"]` - Rails environment you're deploying to, if not set on Heroku
* `ENV["AIRBRAKE_API_KEY"]` - API key if not saved on Heroku or in initializer
* `ENV["HEROKU_APP"]` - app name if you have multiple Heroku apps
-* `ENV["REPO"]` - Github url of the repo you're deploying
+* `ENV["REPO"]` - Github url of the repo you're deploying, set this if you're not using remote named "origin"
We will also set "username" and "revision" from Heroku variables.
@@ -43,7 +43,7 @@ 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 || ENV["AIRBRAKE_API_KEY"]
heroku_app = ENV["HEROKU_APP"]
- repo = ENV["REPO"]
+ repo = `git config --get remote.origin.url` || ENV["REPO"]
command = %Q(heroku addons:add deployhooks:http --url="http://airbrake.io/deploys.txt?api_key=#{heroku_api_key})
command << "&deploy[local_username]={{user}}"

0 comments on commit dbc50e5

Please sign in to comment.