Use puma as a webserver, try to preload constants
This commit is contained in:
parent
c1da6228a7
commit
7bd90a4ef3
2
Gemfile
2
Gemfile
|
@ -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
|
# 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 'simple_states', github: 'svenfuchs/simple_states', branch: 'sf-set-state-early'
|
||||||
|
|
||||||
gem 'thin'
|
gem 'puma'
|
||||||
gem "sentry-raven", github: 'getsentry/raven-ruby'
|
gem "sentry-raven", github: 'getsentry/raven-ruby'
|
||||||
gem 'yard-sinatra', github: 'rkh/yard-sinatra'
|
gem 'yard-sinatra', github: 'rkh/yard-sinatra'
|
||||||
gem 'rack-contrib', github: 'rack/rack-contrib'
|
gem 'rack-contrib', github: 'rack/rack-contrib'
|
||||||
|
|
|
@ -96,7 +96,7 @@ GIT
|
||||||
|
|
||||||
GIT
|
GIT
|
||||||
remote: git://github.com/travis-ci/travis-support.git
|
remote: git://github.com/travis-ci/travis-support.git
|
||||||
revision: a214c215e1b52bdf4d3ab5d31e7e2df52fad5a0c
|
revision: cf916e10949db43ce6f2b6f86082b367f04acfcd
|
||||||
specs:
|
specs:
|
||||||
travis-support (0.0.1)
|
travis-support (0.0.1)
|
||||||
|
|
||||||
|
@ -220,6 +220,8 @@ GEM
|
||||||
coderay (~> 1.0.5)
|
coderay (~> 1.0.5)
|
||||||
method_source (~> 0.8)
|
method_source (~> 0.8)
|
||||||
slop (~> 3.4)
|
slop (~> 3.4)
|
||||||
|
puma (1.6.3)
|
||||||
|
rack (~> 1.2)
|
||||||
pusher (0.11.2)
|
pusher (0.11.2)
|
||||||
multi_json (~> 1.0)
|
multi_json (~> 1.0)
|
||||||
signature (~> 0.1.6)
|
signature (~> 0.1.6)
|
||||||
|
@ -299,6 +301,7 @@ DEPENDENCIES
|
||||||
micro_migrations!
|
micro_migrations!
|
||||||
mocha (~> 0.12)
|
mocha (~> 0.12)
|
||||||
pry
|
pry
|
||||||
|
puma
|
||||||
rack-cache (~> 1.2)
|
rack-cache (~> 1.2)
|
||||||
rack-contrib!
|
rack-contrib!
|
||||||
rake (~> 0.9.2)
|
rake (~> 0.9.2)
|
||||||
|
@ -308,7 +311,6 @@ DEPENDENCIES
|
||||||
simple_states!
|
simple_states!
|
||||||
sinatra!
|
sinatra!
|
||||||
sinatra-contrib!
|
sinatra-contrib!
|
||||||
thin
|
|
||||||
travis-api!
|
travis-api!
|
||||||
travis-core!
|
travis-core!
|
||||||
travis-sidekiqs!
|
travis-sidekiqs!
|
||||||
|
|
|
@ -5,4 +5,10 @@ ENV['RAILS_ENV'] = ENV['RACK_ENV']
|
||||||
$stdout.sync = true
|
$stdout.sync = true
|
||||||
|
|
||||||
require 'travis/api/app'
|
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
|
run Travis::Api::App.new
|
||||||
|
|
|
@ -3,6 +3,6 @@ cd "$(dirname "$0")/.."
|
||||||
[ $PORT ] || PORT=3000
|
[ $PORT ] || PORT=3000
|
||||||
[ $RACK_ENV ] || RACK_ENV=development
|
[ $RACK_ENV ] || RACK_ENV=development
|
||||||
|
|
||||||
cmd="ruby -I lib -S bundle exec ruby -I lib -S thin start -p $PORT -e $RACK_ENV" #--threaded"
|
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 -a 127.0.0.1"
|
[[ $RACK_ENV == "development" ]] && exec rerun "$cmd -b tcp://127.0.0.1:$PORT"
|
||||||
exec $cmd
|
exec $cmd
|
||||||
|
|
Loading…
Reference in New Issue
Block a user