Guest User

Untitled

a guest
Apr 13th, 2018
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. shared: &shared
  2. # Use different adapters with JRuby vs. MRI
  3. adapter: <%= defined?(JRuby) ? "jdbcmysql" : "mysql" %>
  4. encoding: utf8
  5. username: root
  6. password:
  7. host: localhost
  8. socket: /opt/local/var/run/mysql5/mysqld.sock
  9.  
  10. <%
  11. # For the git branches listed in DB_BRANCHES, use a dev DB with the same name.
  12. # For other branches, use the DEFAULT_DB.
  13. DEFAULT_DB = 'myproject_dev'
  14. DB_BRANCHES = %w[ t123 t456 ]
  15. branch = `git symbolic-ref HEAD 2> /dev/null`.chomp.split('/').last
  16. dev_db = DB_BRANCHES.include?(branch) ? branch : DEFAULT_DB
  17. puts "Using dev database: #{dev_db.inspect}"
  18. %>
  19. development:
  20. <<: *shared
  21. database: <%= dev_db %>
Add Comment
Please, Sign In to add comment