try to get travis build working

This commit is contained in:
Kyle Drake 2014-04-12 14:02:12 -07:00
parent d83cef0e09
commit d6f567e765
3 changed files with 21 additions and 1 deletions

View file

@ -1,3 +1,7 @@
language: ruby
rvm:
- "2.1.0"
addons:
postgresql: "9.3"
before_script:
- psql -c 'create database travis_ci_test;' -U postgres

7
config.yml.travis Normal file
View file

@ -0,0 +1,7 @@
database: 'postgres://postgres@localhost/travis_ci_test'
database_pool: 1
session_secret: 's3cr3t'
recaptcha_public_key: '1234'
recaptcha_private_key: '5678'
phantomjs_url:
- http://localhost:8910

View file

@ -12,7 +12,16 @@ require 'zip'
Bundler.require
Bundler.require :development if ENV['RACK_ENV'] == 'development'
$config = YAML.load_file(File.join(DIR_ROOT, 'config.yml'))[ENV['RACK_ENV']]
if ENV['TRAVIS']
$config = YAML.load_file File.join(DIR_ROOT, 'config.yml.travis')
else
begin
$config = YAML.load_file(File.join(DIR_ROOT, 'config.yml'))[ENV['RACK_ENV']]
rescue Errno::ENOENT
puts "ERROR: Please provide a config.yml file."
exit
end
end
DB = Sequel.connect $config['database'], sslmode: 'disable', max_connections: $config['database_pool']
DB.extension :pagination