add the postgres addon if no DATABASE_URL is known.

Andrew Cantino 10 年 前
コミット
cf5aaf5646
共有1 個のファイルを変更した7 個の追加1 個の削除を含む
  1. 7 1
      bin/setup_heroku

+ 7 - 1
bin/setup_heroku

@@ -81,10 +81,16 @@ unless $config['DOMAIN']
81 81
   first_time = true
82 82
 end
83 83
 
84
-set_value 'BUILDPACK_URL', "https://github.com/ddollar/heroku-buildpack-multi.git"
84
+set_value 'BUILDPACK_URL', "https://github.com/heroku/heroku-buildpack-multi.git"
85 85
 set_value 'PROCFILE_PATH', "deployment/heroku/Procfile.heroku", force: false
86 86
 set_value 'ON_HEROKU', "true"
87 87
 
88
+unless $config['DATABASE_URL']
89
+  puts "Setting up the postgres addon"
90
+  puts capture("heroku addons:add heroku-postgresql")
91
+  puts
92
+end
93
+
88 94
 unless $config['SMTP_DOMAIN'] && $config['SMTP_USER_NAME'] && $config['SMTP_PASSWORD'] && $config['SMTP_SERVER'] && $config['EMAIL_FROM_ADDRESS']
89 95
   puts "Okay, let's setup outgoing email settings.  The simplest solution is to use the free sendgrid Heroku addon."
90 96
   puts "If you'd like to use your own server, or your Gmail account, please see .env.example and set"