Guest User

Untitled

a guest
Apr 11th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. # Assembles Rails database.yml based on information
  2. # provided from a ReadyStack redeploy
  3. #
  4. # WC_DB_ENGINE = [mysql|postgresql]
  5. # WC_APP_NAME = The name of you app, the GitHub repo name
  6. # WC_DB_PASSWORD = the DB password, chosen on the UI
  7. echo WC_DB_ENGINE=${WC_DB_ENGINE}
  8.  
  9. echo "
  10. login: &login
  11. adapter: ${WC_DB_ENGINE}
  12. database: ${WC_APP_NAME}
  13. username: ${WC_APP_NAME}
  14. password: ${WC_DB_PASSWORD}
  15. host: localhost
  16. " > config/database.yml
  17.  
  18. if [ "${WC_DB_ENGINE}" == "mysql" ]; then
  19. echo "
  20. production:
  21. <<: *login
  22. encoding: utf8
  23. " >> config/database.yml
  24. fi
  25.  
  26. if [ "${WC_DB_ENGINE}" == "postgresql" ]; then
  27. echo "
  28. production:
  29. <<: *login
  30. encoding: unicode
  31. pool: 5
  32. port: 5432
  33. " >> config/database.yml
  34. fi
Add Comment
Please, Sign In to add comment