Guest User

Untitled

a guest
Mar 12th, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. <%
  2. db_proj_name = 'your project name on db'
  3. scm_proj_name = 'your project name on scm'
  4. branch = `git status`.scan(/\# On branch ([^\s]+?)$/).flatten.first if File.exist?('./.git')
  5. branch ||= `svn info`.scan(/\/#{scm_proj_name}\/(?:branches\/(.*?))\/|(trunk)/).flatten.compact.first if File.exist?('./.svn')
  6. branch = branch ? '_' << branch.sub(/^local[\-_]/, '').sub('-', '_') : ''
  7. %>
  8.  
  9. common: &common
  10. adapter: mysql
  11. encoding: utf8
  12. username: root
  13. password:
  14. socket: /opt/local/var/run/mysql5/mysqld.sock
  15.  
  16. development:
  17. database: <%= db_proj_name %><%= branch %>_development
  18. <<: *common
  19.  
  20. test:
  21. database: <%= db_proj_name %><%= branch %>_test
  22. <<: *common
  23.  
  24. production:
  25. database: <%= db_proj_name %><%= branch %>_production
  26. <<: *common
Add Comment
Please, Sign In to add comment