Browse Source

Add docs, and handle bundle08

Troy Davis 15 years ago
parent
commit
7c490ac7d0
2 changed files with 6 additions and 3 deletions
  1. 3 0
      README.md
  2. 3 3
      recipes/rails.rb

+ 3 - 0
README.md

@@ -58,6 +58,9 @@ Using the node's `run_state` that contains the current application in the search
 
 This recipe can be used on nodes that are going to run the application, or on nodes that need to have the application code checkout available such as supporting utility nodes or a configured load balancer that needs static assets stored in the application repository.
 
+For Gem Bundler: include `bundler` or `bundle08` in the gems list.  `bundle install` will be run before migrations.
+For config.gem in environment: `rake gems:install RAILS_ENV=<node environment>` will be run when `bundle install` is not.
+
 unicorn
 -------
 

+ 3 - 3
recipes/rails.rb

@@ -183,10 +183,10 @@ deploy_revision app['id'] do
   })
 
   before_migrate do
-    if app['gems'].include?('bundler')
+    if app['gems'].has_key?('bundler') or app['gems'].has_key?('bundle08')
       execute "bundle install" 
-    else
-      execute "rake gems:install"
+    elsif node.app_environment && app['databases'].has_key?(node.app_environment)
+      execute "rake gems:install RAILS_ENV=#{app['migrate'][node.app_environment]}"
     end
   end
 end