Skip to content

Instantly share code, notes, and snippets.

@mikehale
Created June 5, 2009 15:40
Show Gist options
  • Select an option

  • Save mikehale/124332 to your computer and use it in GitHub Desktop.

Select an option

Save mikehale/124332 to your computer and use it in GitHub Desktop.
db:clone_to_local Thanks engineyard!
# require this file from your deploy.rb and you'll be able to db:clone_to_local
require 'eycap'
namespace :db do
task :yml do
set :database_yml, YAML.load(capture("cat #{shared_path}/config/database.yml"))[rails_env]
end
end
before "db:backup_name", "db:yml"
set(:environment_database) { database_yml['database'] }
set(:environment_dbhost) { database_yml['host'] }
set(:dbuser) { database_yml['username'] }
set(:dbpass) { database_yml['password'] }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment