Skip to content

Instantly share code, notes, and snippets.

@febuiles
Created October 29, 2008 18:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save febuiles/20781 to your computer and use it in GitHub Desktop.
Save febuiles/20781 to your computer and use it in GitHub Desktop.
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