Skip to content

Commit

Permalink
Add a .env sample for a local foreman, add a unicorn config, and upgr…
Browse files Browse the repository at this point in the history
…ade rails to 4.0.3
  • Loading branch information
reconbot committed Mar 3, 2014
1 parent 6326ce2 commit 86d2424
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 57 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -16,3 +16,4 @@
/tmp /tmp
.ruby-version .ruby-version
.DS_Store .DS_Store
.env
8 changes: 4 additions & 4 deletions Gemfile
@@ -1,7 +1,7 @@
source 'https://rubygems.org' source 'https://rubygems.org'
ruby "2.0.0" ruby "2.0.0"


gem 'rails', '4.0.0' gem 'rails', '4.0.3'


group :development do group :development do
gem "pry-rails" gem "pry-rails"
Expand All @@ -13,11 +13,11 @@ group :production do
gem 'rails_12factor' gem 'rails_12factor'
end end


gem 'sass-rails', '~> 4.0.0' gem 'sass-rails'
gem 'bootstrap-sass', github: 'thomas-mcdonald/bootstrap-sass', branch: '3' gem 'bootstrap-sass'
gem "font-awesome-rails" gem "font-awesome-rails"
gem 'uglifier', '>= 1.3.0' gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0' gem 'coffee-rails'
gem 'jquery-rails' gem 'jquery-rails'
gem 'turbolinks' gem 'turbolinks'
gem 'jbuilder', '~> 1.2' gem 'jbuilder', '~> 1.2'
Expand Down
99 changes: 46 additions & 53 deletions Gemfile.lock
@@ -1,11 +1,3 @@
GIT
remote: git://github.com/thomas-mcdonald/bootstrap-sass.git
revision: f4294bfd0218a181a3c288dba7cb9811a99b9f83
branch: 3
specs:
bootstrap-sass (3.0.0.0)
sass (~> 3.2)

GIT GIT
remote: https://github.com/mongoid/mongoid.git remote: https://github.com/mongoid/mongoid.git
revision: 5d8397e24b673724f4b70ca2923a62bfe20e6e79 revision: 5d8397e24b673724f4b70ca2923a62bfe20e6e79
Expand All @@ -19,57 +11,58 @@ GIT
GEM GEM
remote: https://rubygems.org/ remote: https://rubygems.org/
specs: specs:
actionmailer (4.0.0) actionmailer (4.0.3)
actionpack (= 4.0.0) actionpack (= 4.0.3)
mail (~> 2.5.3) mail (~> 2.5.4)
actionpack (4.0.0) actionpack (4.0.3)
activesupport (= 4.0.0) activesupport (= 4.0.3)
builder (~> 3.1.0) builder (~> 3.1.0)
erubis (~> 2.7.0) erubis (~> 2.7.0)
rack (~> 1.5.2) rack (~> 1.5.2)
rack-test (~> 0.6.2) rack-test (~> 0.6.2)
activemodel (4.0.0) activemodel (4.0.3)
activesupport (= 4.0.0) activesupport (= 4.0.3)
builder (~> 3.1.0) builder (~> 3.1.0)
activerecord (4.0.0) activerecord (4.0.3)
activemodel (= 4.0.0) activemodel (= 4.0.3)
activerecord-deprecated_finders (~> 1.0.2) activerecord-deprecated_finders (~> 1.0.2)
activesupport (= 4.0.0) activesupport (= 4.0.3)
arel (~> 4.0.0) arel (~> 4.0.0)
activerecord-deprecated_finders (1.0.3) activerecord-deprecated_finders (1.0.3)
activesupport (4.0.0) activesupport (4.0.3)
i18n (~> 0.6, >= 0.6.4) i18n (~> 0.6, >= 0.6.4)
minitest (~> 4.2) minitest (~> 4.2)
multi_json (~> 1.3) multi_json (~> 1.3)
thread_safe (~> 0.1) thread_safe (~> 0.1)
tzinfo (~> 0.3.37) tzinfo (~> 0.3.37)
arel (4.0.0) arel (4.0.2)
atomic (1.1.10) atomic (1.1.15)
better_errors (0.9.0) better_errors (0.9.0)
coderay (>= 1.0.0) coderay (>= 1.0.0)
erubis (>= 2.6.6) erubis (>= 2.6.6)
binding_of_caller (0.7.2) binding_of_caller (0.7.2)
debug_inspector (>= 0.0.1) debug_inspector (>= 0.0.1)
bootstrap-sass (3.1.1.0)
sass (~> 3.2)
builder (3.1.4) builder (3.1.4)
coderay (1.0.9) coderay (1.0.9)
coffee-rails (4.0.0) coffee-rails (4.0.1)
coffee-script (>= 2.2.0) coffee-script (>= 2.2.0)
railties (>= 4.0.0.beta, < 5.0) railties (>= 4.0.0, < 5.0)
coffee-script (2.2.0) coffee-script (2.2.0)
coffee-script-source coffee-script-source
execjs execjs
coffee-script-source (1.6.3) coffee-script-source (1.7.0)
debug_inspector (0.0.2) debug_inspector (0.0.2)
erubis (2.7.0) erubis (2.7.0)
execjs (1.4.0) execjs (2.0.2)
multi_json (~> 1.0)
figaro (0.6.4) figaro (0.6.4)
bundler (~> 1.0) bundler (~> 1.0)
rails (>= 3, < 5) rails (>= 3, < 5)
font-awesome-rails (3.2.1.2) font-awesome-rails (3.2.1.2)
railties (>= 3.2, < 5.0) railties (>= 3.2, < 5.0)
hike (1.2.3) hike (1.2.3)
i18n (0.6.4) i18n (0.6.9)
jbuilder (1.4.2) jbuilder (1.4.2)
activesupport (>= 3.0.0) activesupport (>= 3.0.0)
multi_json (>= 1.2.0) multi_json (>= 1.2.0)
Expand All @@ -81,12 +74,12 @@ GEM
mime-types (~> 1.16) mime-types (~> 1.16)
treetop (~> 1.4.8) treetop (~> 1.4.8)
method_source (0.8.2) method_source (0.8.2)
mime-types (1.23) mime-types (1.25.1)
minitest (4.7.5) minitest (4.7.5)
moped (1.5.0) moped (1.5.0)
multi_json (1.7.7) multi_json (1.8.4)
origin (1.1.0) origin (1.1.0)
polyglot (0.3.3) polyglot (0.3.4)
pry (0.9.12.4) pry (0.9.12.4)
coderay (~> 1.0) coderay (~> 1.0)
method_source (~> 0.8) method_source (~> 0.8)
Expand All @@ -96,51 +89,51 @@ GEM
rack (1.5.2) rack (1.5.2)
rack-test (0.6.2) rack-test (0.6.2)
rack (>= 1.0) rack (>= 1.0)
rails (4.0.0) rails (4.0.3)
actionmailer (= 4.0.0) actionmailer (= 4.0.3)
actionpack (= 4.0.0) actionpack (= 4.0.3)
activerecord (= 4.0.0) activerecord (= 4.0.3)
activesupport (= 4.0.0) activesupport (= 4.0.3)
bundler (>= 1.3.0, < 2.0) bundler (>= 1.3.0, < 2.0)
railties (= 4.0.0) railties (= 4.0.3)
sprockets-rails (~> 2.0.0) sprockets-rails (~> 2.0.0)
rails_12factor (0.0.2) rails_12factor (0.0.2)
rails_serve_static_assets rails_serve_static_assets
rails_stdout_logging rails_stdout_logging
rails_serve_static_assets (0.0.1) rails_serve_static_assets (0.0.1)
rails_stdout_logging (0.0.1) rails_stdout_logging (0.0.1)
railties (4.0.0) railties (4.0.3)
actionpack (= 4.0.0) actionpack (= 4.0.3)
activesupport (= 4.0.0) activesupport (= 4.0.3)
rake (>= 0.8.7) rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0) thor (>= 0.18.1, < 2.0)
raindrops (0.11.0) raindrops (0.11.0)
rake (10.1.0) rake (10.1.1)
sass (3.2.9) sass (3.2.14)
sass-rails (4.0.0) sass-rails (4.0.1)
railties (>= 4.0.0.beta, < 5.0) railties (>= 4.0.0, < 5.0)
sass (>= 3.1.10) sass (>= 3.1.10)
sprockets-rails (~> 2.0.0) sprockets-rails (~> 2.0.0)
slop (3.4.7) slop (3.4.7)
sprockets (2.10.0) sprockets (2.11.0)
hike (~> 1.2) hike (~> 1.2)
multi_json (~> 1.0) multi_json (~> 1.0)
rack (~> 1.0) rack (~> 1.0)
tilt (~> 1.1, != 1.3.0) tilt (~> 1.1, != 1.3.0)
sprockets-rails (2.0.0) sprockets-rails (2.0.1)
actionpack (>= 3.0) actionpack (>= 3.0)
activesupport (>= 3.0) activesupport (>= 3.0)
sprockets (~> 2.8) sprockets (~> 2.8)
thor (0.18.1) thor (0.18.1)
thread_safe (0.1.0) thread_safe (0.2.0)
atomic atomic (>= 1.1.7, < 2)
tilt (1.4.1) tilt (1.4.1)
treetop (1.4.14) treetop (1.4.15)
polyglot polyglot
polyglot (>= 0.3.1) polyglot (>= 0.3.1)
turbolinks (1.3.0) turbolinks (1.3.0)
coffee-rails coffee-rails
tzinfo (0.3.37) tzinfo (0.3.38)
uglifier (2.1.2) uglifier (2.1.2)
execjs (>= 0.3.0) execjs (>= 0.3.0)
multi_json (~> 1.0, >= 1.0.2) multi_json (~> 1.0, >= 1.0.2)
Expand All @@ -158,17 +151,17 @@ PLATFORMS
DEPENDENCIES DEPENDENCIES
better_errors better_errors
binding_of_caller binding_of_caller
bootstrap-sass! bootstrap-sass
coffee-rails (~> 4.0.0) coffee-rails
figaro figaro
font-awesome-rails font-awesome-rails
jbuilder (~> 1.2) jbuilder (~> 1.2)
jquery-rails jquery-rails
mongoid! mongoid!
pry-rails pry-rails
rails (= 4.0.0) rails (= 4.0.3)
rails_12factor rails_12factor
sass-rails (~> 4.0.0) sass-rails
turbolinks turbolinks
uglifier (>= 1.3.0) uglifier (>= 1.3.0)
unicorn unicorn
Expand Down
25 changes: 25 additions & 0 deletions config/unicorn.rb
@@ -0,0 +1,25 @@
# config/unicorn.rb
worker_processes 3
timeout 30
preload_app true

before_fork do |server, worker|

Signal.trap 'TERM' do
puts 'Unicorn master intercepting TERM and sending myself QUIT instead'
Process.kill 'QUIT', Process.pid
end

defined?(ActiveRecord::Base) and
ActiveRecord::Base.connection.disconnect!
end

after_fork do |server, worker|

Signal.trap 'TERM' do
puts 'Unicorn worker intercepting TERM and doing nothing. Wait for master to sent QUIT'
end

defined?(ActiveRecord::Base) and
ActiveRecord::Base.establish_connection
end
2 changes: 2 additions & 0 deletions env.sample
@@ -0,0 +1,2 @@
PORT=3000
RACK_ENV=DEVELOPMENT

0 comments on commit 86d2424

Please sign in to comment.