Commit 82f244ed

mo k <mo@mokhan.ca>
2012-09-22 22:53:26
pick out the target env when symlink to the proper database settings file.
1 parent 6c4e2db
Changed files (1)
config/deploy.rb
@@ -27,8 +27,8 @@ after 'deploy:update_code', 'deploy:symlink_db'
 
 namespace :deploy do
   task :symlink_db, :roles => :app do
-    # todo: need to replace 'production' with target environment
-    run "ln -nfs #{release_path}/config/database.production.yml.example #{release_path}/config/database.yml"
+    environment = ARGV[0]
+    run "ln -nfs #{release_path}/config/database.#{environment}.yml.example #{release_path}/config/database.yml"
     #run "ln -nfs #{deploy_to}/shared/config/database.yml #{release_path}/config/database.yml"
   end
 end