Commit 12c904e8beb7fd6f9177a371cc5c5212fce832b5
1 parent
b84216e4
Exists in
master
and in
1 other branch
still finding the balance of how many commands to run, how much responsibility each command has
Showing
2 changed files
with
17 additions
and
16 deletions
Show diff stats
lib/tasks/heroku.rake
@@ -25,7 +25,7 @@ namespace :heroku do | @@ -25,7 +25,7 @@ namespace :heroku do | ||
25 | vars[:GOOGLE_ANALYTICS_TRACKER_ID] = ask_value('Google Analytics tracker id') | 25 | vars[:GOOGLE_ANALYTICS_TRACKER_ID] = ask_value('Google Analytics tracker id') |
26 | end | 26 | end |
27 | 27 | ||
28 | - if ask_yn("Use Hoptoad to store production execptions?") | 28 | + if ask_yn("Use Hoptoad for exception notifications?") |
29 | vars[:HOPTOAD_API_KEY] = ask_value('Hoptoad API key') | 29 | vars[:HOPTOAD_API_KEY] = ask_value('Hoptoad API key') |
30 | end | 30 | end |
31 | 31 | ||
@@ -35,8 +35,20 @@ namespace :heroku do | @@ -35,8 +35,20 @@ namespace :heroku do | ||
35 | end | 35 | end |
36 | 36 | ||
37 | puts "Setting all config vars on Heroku app" | 37 | puts "Setting all config vars on Heroku app" |
38 | - vars_string = vars.map { |k,v| "#{k}='#{v}'" }.join(' ') | ||
39 | - `heroku config:add #{vars_string}` | 38 | + if vars.any? |
39 | + vars_string = vars.map { |k,v| "#{k}='#{v}'" }.join(' ') | ||
40 | + `heroku config:add #{vars_string}` | ||
41 | + end | ||
42 | + | ||
43 | + puts "Deploying..." | ||
44 | + run "git push heroku master" | ||
45 | + run "heroku rake db:migrate" | ||
46 | + | ||
47 | + puts "Opening app..." | ||
48 | + run "heroku open" | ||
49 | + | ||
50 | + puts "Rename your app at any time with..." | ||
51 | + puts "heroku rename newname" | ||
40 | end | 52 | end |
41 | 53 | ||
42 | desc "Create a new app" | 54 | desc "Create a new app" |
script/create_project
1 | #!/usr/bin/env ruby | 1 | #!/usr/bin/env ruby |
2 | require File.dirname(__FILE__) + '/../config/boot' | 2 | require File.dirname(__FILE__) + '/../config/boot' |
3 | -require File.join(File.dirname(__FILE__), "..", "lib", "tasks", "heroku.rake") | ||
4 | require 'rubygems' | 3 | require 'rubygems' |
5 | require 'activesupport' | 4 | require 'activesupport' |
6 | require 'pathname' | 5 | require 'pathname' |
@@ -55,20 +54,10 @@ end | @@ -55,20 +54,10 @@ end | ||
55 | 54 | ||
56 | run("git commit -a -m 'New Heroku Suspenders app'") | 55 | run("git commit -a -m 'New Heroku Suspenders app'") |
57 | 56 | ||
58 | -run "rake heroku:setup" | ||
59 | - | ||
60 | -puts "Deploying..." | ||
61 | -run "git push heroku master" | ||
62 | -run "heroku rake db:migrate" | ||
63 | - | ||
64 | -puts "Opening app..." | ||
65 | -run "heroku open" | ||
66 | - | ||
67 | run("rake db:migrate RAILS_ENV=development") | 57 | run("rake db:migrate RAILS_ENV=development") |
68 | run("rake db:migrate RAILS_ENV=test") | 58 | run("rake db:migrate RAILS_ENV=test") |
69 | run("rake db:migrate RAILS_ENV=cucumber") | 59 | run("rake db:migrate RAILS_ENV=cucumber") |
70 | -run("rake") | ||
71 | 60 | ||
72 | -puts "Rename your app at any time with:" | ||
73 | -puts "heroku rename newname" | 61 | +puts "Next: run the tests, configure Heroku, deploy!" |
62 | +puts "cd ../#{project_name} && rake && rake heroku:setup" | ||
74 | 63 |