Permalink
Browse files

include some helpful Heroku instructions to README for suspended Hero…

…ku apps
  • Loading branch information...
1 parent c5ba370 commit 5a4c2579c4db08bd2f51ae7144de942d02643720 @croaky croaky committed Dec 4, 2011
Showing with 79 additions and 2 deletions.
  1. +8 −2 lib/suspenders/app_builder.rb
  2. +1 −0 lib/suspenders/generators/app_generator.rb
  3. +66 −0 templates/HEROKU_README.md
  4. +4 −0 templates/README.md
@@ -59,7 +59,7 @@ def create_database
def include_custom_gems
additions_path = find_in_source_paths 'Gemfile_additions'
new_gems = File.open(additions_path).read
- insert_into_file("Gemfile", "\n#{new_gems}", :after => /gem 'jquery-rails'/)
+ inject_into_file("Gemfile", "\n#{new_gems}", :after => /gem 'jquery-rails'/)
end
def configure_rspec
@@ -143,6 +143,12 @@ def create_heroku_apps
run "#{path_addition} heroku create #{app_name}-staging --remote=staging --stack=cedar"
end
+ def document_heroku
+ heroku_readme_path = find_in_source_paths 'HEROKU_README.md'
+ documentation = File.open(heroku_readme_path).read
+ inject_into_file("README.md", "#{documentation}\n", :before => "Most importantly")
+ end
+
def copy_miscellaneous_files
copy_file "errors.rb", "config/initializers/errors.rb"
copy_file "time_formats.rb", "config/initializers/time_formats.rb"
@@ -178,7 +184,7 @@ def setup_default_rake_task
end
def add_clearance_gem
- insert_into_file("Gemfile", "\ngem 'clearance'", :after => /gem 'jquery-rails'/)
+ inject_into_file("Gemfile", "\ngem 'clearance'", :after => /gem 'jquery-rails'/)
end
end
end
@@ -126,6 +126,7 @@ def create_heroku_apps
if options['heroku']
say "Creating heroku apps"
build(:create_heroku_apps)
+ build(:document_heroku)
end
end
View
@@ -0,0 +1,66 @@
+Staging and production environments
+-----------------------------------
+
+We're using Heroku as a hosting provider. Deploying to Heroku is done via git. So, set up your git remotes for each environment:
+
+ git remote add staging git@heroku.com:your-app-staging.git
+ git remote add production git@heroku.com:your-app-production.git
+
+Heroku
+------
+
+The following are mostly aliases from the `dotfiles` script.
+
+To access your code on Heroku:
+
+ staging
+ production
+
+That will drop you into a Rails console for either environment. You can run ActiveRecord queries from there.
+
+To dump staging or production data into your development environment:
+
+ db-pull-staging
+ db-pull-production
+
+You will see progress bars for each db index and table.
+
+We can create a database backup at any time:
+
+ db-backup-production
+
+View backups:
+
+ db-backups
+
+To destroy a backup:
+
+ heroku pgbackups:destroy b003 --remote production
+
+Transfer production data to staging:
+
+ db-copy-production-to-staging
+
+More information in the [Dev Center](http://devcenter.heroku.com/articles/pgbackups).
+
+To check the status of running app servers, background jobs, cron jobs, etc:
+
+ staging-process
+ production-process
+
+To see the performance of the staging application, see:
+
+ https://heroku.newrelic.com/...
+
+To see the performance of the production application, see:
+
+ https://heroku.newrelic.com/...
+
+ENV variables
+-------------
+
+ENV variables like AWS keys should not be in the source code. They are configuration and should be stored as ENV variables. On Heroku, they are called "config variables." You can pull config variables using the `heroku-config` plugin that comes with the `laptop` script:
+
+ heroku config:pull --remote staging
+
+You'll see the Amazon credentials as config vars. You should delete lines that don't apply, like Redis to Go connection strings.
View
@@ -75,3 +75,7 @@ Open up the Github repo, change into your feature-branch branch. Press the "Pull
For more details and screenshots of the feature branch code review process, read [this blog post](http://robots.thoughtbot.com/post/2831837714/feature-branch-code-reviews).
+Most importantly
+----------------
+
+Have fun!

0 comments on commit 5a4c257

Please sign in to comment.