Use puma as a webserver, try to preload constants

This commit is contained in:
Piotr Sarnacki 2013-01-19 20:07:28 +01:00
parent c1da6228a7
commit 7bd90a4ef3
4 changed files with 13 additions and 5 deletions

View File

@ -12,7 +12,7 @@ gem 'sinatra-contrib', github: 'sinatra/sinatra-contrib', require: nil
# TODO need to release the gem as soon i'm certain this change makes sense
gem 'simple_states', github: 'svenfuchs/simple_states', branch: 'sf-set-state-early'
gem 'thin'
gem 'puma'
gem "sentry-raven", github: 'getsentry/raven-ruby'
gem 'yard-sinatra', github: 'rkh/yard-sinatra'
gem 'rack-contrib', github: 'rack/rack-contrib'

View File

@ -96,7 +96,7 @@ GIT
GIT
remote: git://github.com/travis-ci/travis-support.git
revision: a214c215e1b52bdf4d3ab5d31e7e2df52fad5a0c
revision: cf916e10949db43ce6f2b6f86082b367f04acfcd
specs:
travis-support (0.0.1)
@ -220,6 +220,8 @@ GEM
coderay (~> 1.0.5)
method_source (~> 0.8)
slop (~> 3.4)
puma (1.6.3)
rack (~> 1.2)
pusher (0.11.2)
multi_json (~> 1.0)
signature (~> 0.1.6)
@ -299,6 +301,7 @@ DEPENDENCIES
micro_migrations!
mocha (~> 0.12)
pry
puma
rack-cache (~> 1.2)
rack-contrib!
rake (~> 0.9.2)
@ -308,7 +311,6 @@ DEPENDENCIES
simple_states!
sinatra!
sinatra-contrib!
thin
travis-api!
travis-core!
travis-sidekiqs!

View File

@ -5,4 +5,10 @@ ENV['RAILS_ENV'] = ENV['RACK_ENV']
$stdout.sync = true
require 'travis/api/app'
require 'core_ext/module/load_constants'
[Travis::Api, Travis, GH].each do |target|
target.load_constants!(:only => [/^Travis/, /^GH/], :skip => ['Travis::Memory', 'GH::ResponseWrapper'], :debug => true)
end
run Travis::Api::App.new

View File

@ -3,6 +3,6 @@ cd "$(dirname "$0")/.."
[ $PORT ] || PORT=3000
[ $RACK_ENV ] || RACK_ENV=development
cmd="ruby -I lib -S bundle exec ruby -I lib -S thin start -p $PORT -e $RACK_ENV" #--threaded"
[[ $RACK_ENV == "development" ]] && exec rerun "$cmd -a 127.0.0.1"
cmd="ruby -I lib -S bundle exec ruby -I lib -S puma config.ru -p $PORT -e $RACK_ENV --threads 0:16"
[[ $RACK_ENV == "development" ]] && exec rerun "$cmd -b tcp://127.0.0.1:$PORT"
exec $cmd