Skip to content

Commit

Permalink
More compatible mysql.sock location
Browse files Browse the repository at this point in the history
  • Loading branch information
mislav committed Sep 20, 2016
1 parent 5d92ee2 commit 628e25e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
4 changes: 2 additions & 2 deletions script/bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ set -e

brew bundle

while [ ! -e /tmp/mysql.sock ]; do
echo "Waiting for /tmp/mysql.sock ..." >&2
while [ ! -e /tmp/mysql.sock ] && [ ! -e /var/run/mysql5/mysqld.sock ]; do
echo "Waiting for mysql to start up ..." >&2
sleep 1
done

Expand Down
18 changes: 11 additions & 7 deletions spec/database.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,27 @@ sqlite3:
adapter: sqlite3
timeout: 500

mysql:
mysql: &mysql
adapter: mysql
database: will_paginate
username:
encoding: utf8
socket: <%= ENV["BOXEN_MYSQL_SOCKET"] %>
<% if File.exist?("/var/run/mysql5/mysqld.sock") %>
host: localhost
socket: /var/run/mysql5/mysqld.sock
<% elsif File.exist? "/tmp/mysql.sock" %>
host: localhost
socket: /tmp/mysql.sock
<% else %>
host: 127.0.0.1
<% end %>

mysql2:
<<: *mysql
adapter: mysql2
database: will_paginate
username:
encoding: utf8
socket: <%= ENV["BOXEN_MYSQL_SOCKET"] %>

postgres:
adapter: postgresql
database: will_paginate
username: <%= "postgres" if ENV["TRAVIS"] %>
min_messages: warning
port: <%= ENV["BOXEN_POSTGRESQL_PORT"] %>

0 comments on commit 628e25e

Please sign in to comment.