Fix Travis

This commit is contained in:
Hakan Ensari 2018-10-12 12:49:43 +01:00
parent c1e1644c52
commit e7fe4d8f44
2 changed files with 15 additions and 5 deletions

View File

@ -7,15 +7,25 @@ rvm:
addons:
postgresql: 10
before_install:
- "psql -c 'create database frankfurter_test;' -U postgres"
apt:
packages:
- postgresql-10
- postgresql-client-10
services:
- docker
bundler_args: "--without development test"
before_install:
- sudo sed -i -e '/local.*peer/s/postgres/all/' -e 's/peer\|md5/trust/g' /etc/postgresql/*/main/pg_hba.conf
- sudo service postgresql restart
- sleep 1
- psql -c 'create database frankfurter_test;' -U postgres
bundler_args: --without development
env:
global:
- APP_ENV=test
- PGPORT=5433
deploy:
provider: script

View File

@ -6,5 +6,5 @@ require 'sequel'
Sequel.extension :pg_json_ops
Sequel.single_threaded = true
Sequel.connect(ENV['DATABASE_URL'] ||
"postgres://localhost/frankfurter_#{App.env}")
"postgres://localhost:#{ENV['PGPORT']}/frankfurter_#{App.env}")
.extension :pg_json