Guest User

Untitled

a guest
Feb 20th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. task :setup_production_database_configuration do
  2. mysql_password = Capistrano::CLI.password_prompt("Production MySQL password: ")
  3.  
  4. require 'yaml'
  5. spec = {
  6. "development" => {
  7. "adapter" => "sqlite3",
  8. "database" => "db/development.sqlite3"
  9. },
  10.  
  11. "test" => {
  12. "adapter" => "sqlite3",
  13. "database" => "db/test.sqlite3"
  14. },
  15.  
  16. "production" => {
  17. "adapter" => "mysql",
  18. "database" => "vom_production",
  19. "username" => user,
  20. "password" => mysql_password,
  21. "encoding" => "UTF8"
  22. }
  23. }
  24.  
  25. run "mkdir -p #{shared_path}/config"
  26. put(spec.to_yaml, "#{shared_path}/config/database.yml")
  27. end
  28. after "deploy:setup", :setup_production_database_configuration
Add Comment
Please, Sign In to add comment