Skip to content

Commit

Permalink
heroku install: error checking addons as heroku requires credit card …
Browse files Browse the repository at this point in the history
…on file. related to gh-597
  • Loading branch information
herestomwiththeweather committed Feb 2, 2015
1 parent 8b196e7 commit 7cd7ab9
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
1 change: 0 additions & 1 deletion Gemfile
Expand Up @@ -58,7 +58,6 @@ gem "gibbon", :git => "git://github.com/amro/gibbon.git"
gem "bootstrap_form", "~> 0.3.2"

group :development, :test do
gem 'debugger'
gem "heroku-api"
gem 'sqlite3'
gem "rack"
Expand Down
9 changes: 0 additions & 9 deletions Gemfile.lock
Expand Up @@ -114,7 +114,6 @@ GEM
coffee-script-source
execjs
coffee-script-source (1.4.0)
columnize (0.3.6)
connection_pool (1.0.0)
cucumber (1.2.1)
builder (>= 2.1.2)
Expand All @@ -128,13 +127,6 @@ GEM
dalli (2.6.0)
database_cleaner (0.9.1)
debug_inspector (0.0.2)
debugger (1.3.0)
columnize (>= 0.3.1)
debugger-linecache (~> 1.1.1)
debugger-ruby_core_source (~> 1.1.7)
debugger-linecache (1.1.2)
debugger-ruby_core_source (>= 1.1.1)
debugger-ruby_core_source (1.1.7)
diff-lcs (1.1.3)
dynamic_form (1.1.4)
erubis (2.7.0)
Expand Down Expand Up @@ -413,7 +405,6 @@ DEPENDENCIES
cucumber-rails
dalli
database_cleaner
debugger
dynamic_form
exception_notification!
feed-normalizer
Expand Down
18 changes: 16 additions & 2 deletions lib/tasks/heroku.rake
Expand Up @@ -59,12 +59,22 @@ namespace :heroku do
heroku.put_config_vars(app_name, smtp_vars)
else
print "using SendGrid addon... "
heroku.post_addon(app_name, 'sendgrid:starter')
begin
heroku.post_addon(app_name, 'sendgrid:starter')
rescue Heroku::API::Errors::RequestFailed => e
display_heroku_error(e)
exit
end
end
puts "done."

print "Setting up memcache... "
begin
heroku.post_addon(app_name, 'memcachier')
rescue Heroku::API::Errors::RequestFailed => e
display_heroku_error(e)
exit
end
puts "done."

git = Git.open(Dir.pwd, :log => Logger.new(STDOUT))
Expand Down Expand Up @@ -123,7 +133,11 @@ namespace :heroku do
puts "Thanks!"
end


def display_heroku_error(e)
puts "\n\n*** Installation error ***"
puts JSON.parse(e.response.body)['error']
puts "*** Installation error ***"
end

def auth_to_heroku(ui, config)
heroku_api_key = config['HEROKU_API_KEY'] || ui.ask("Enter your Heroku API key: ")
Expand Down

0 comments on commit 7cd7ab9

Please sign in to comment.