require 'rake'
rake = Rake.application
rake.init
# you can import addition *.rake files
# app.add_import 'some/other/file.rake'
rake.load_rakefile
rake['db:test:prepare'].invoke()
All examples here for deploy RoR application with unicorn, staging machine (where we deploys) available via ssh by ssh_key.
Deploy via remote_cache:
require 'rvm/capistrano'
require 'bundler/capistrano'
set :application, '_proj_'
set :rails_env, 'production'
set :domain, '_user@your_deploy_domain_'
set :deploy_to, "_path_to_#{application}"
set :use_sudo, false
set :unicorn_conf, "#{deploy_to}/current/config/unicorn.rb"
set :unicorn_pid, "#{deploy_to}/shared/pids/u...
Assume your database.yml file looks like this:
{: .yaml}
development:
adapter: postgresql
host: localhost
encoding: unicode
database: proj_development
pool: 5
username: proj
password:
template: template0
test:
adapter: postgresql
host: localhost
encoding: unicode
database: proj_test
pool: 5
username: proj
password:
template: template0
production:
adapter: postgresql
host: localhost
encoding:...