forked from localytics/odbc_adapter
-
Notifications
You must be signed in to change notification settings - Fork 12
/
.travis.yml
43 lines (35 loc) · 1.2 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
sudo: required
language: ruby
cache: bundler
services:
- postgresql
- mysql
addons:
apt:
packages:
- unixodbc
- unixodbc-dev
# MySQL
- libmyodbc
- mysql-client-5.6
# Postgres
- odbc-postgresql
rvm:
- 2.3
- 2.4
- 2.5
env:
- DB=mysql CONN_STR='DRIVER=MySQL;SERVER=localhost;DATABASE=odbc_test;USER=root;PASSWORD=;'
- DB=postgresql CONN_STR='DRIVER={PostgreSQL ANSI};SERVER=localhost;PORT=5432;DATABASE=odbc_test;UID=postgres;'
before_install:
- gem update --system
gemfile:
- gemfiles/active_record_5_0.gemfile
- gemfiles/active_record_5_1.gemfile
- gemfiles/active_record_5_2.gemfile
before_script:
- sh -c "if [ '$DB' = 'mysql' ]; then sudo odbcinst -i -d -f /usr/share/libmyodbc/odbcinst.ini; fi"
- sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'DROP DATABASE IF EXISTS odbc_test; CREATE DATABASE IF NOT EXISTS odbc_test;' -uroot; fi"
- sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'GRANT ALL PRIVILEGES ON *.* TO "root"@"localhost";' -uroot; fi"
- sh -c "if [ '$DB' = 'postgresql' ]; then sudo odbcinst -i -d -f /usr/share/psqlodbc/odbcinst.ini.template; fi"
- sh -c "if [ '$DB' = 'postgresql' ]; then psql -c 'CREATE DATABASE odbc_test;' -U postgres; fi"