Created
October 29, 2008 18:26
-
-
Save febuiles/20781 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
task :setup_production_database_configuration do | |
mysql_password = Capistrano::CLI.password_prompt("Production MySQL password: ") | |
require 'yaml' | |
spec = { | |
"development" => { | |
"adapter" => "sqlite3", | |
"database" => "db/development.sqlite3" | |
}, | |
"test" => { | |
"adapter" => "sqlite3", | |
"database" => "db/test.sqlite3" | |
}, | |
"production" => { | |
"adapter" => "mysql", | |
"database" => "vom_production", | |
"username" => user, | |
"password" => mysql_password, | |
"encoding" => "UTF8" | |
} | |
} | |
run "mkdir -p #{shared_path}/config" | |
put(spec.to_yaml, "#{shared_path}/config/database.yml") | |
end | |
after "deploy:setup", :setup_production_database_configuration |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment