diff --git a/script/bootstrap b/script/bootstrap index 9313106ca..5a26ceb48 100755 --- a/script/bootstrap +++ b/script/bootstrap @@ -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 diff --git a/spec/database.yml b/spec/database.yml index 7930ee841..28a7e545e 100644 --- a/spec/database.yml +++ b/spec/database.yml @@ -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"] %>