Skip to content

Commit

Permalink
thin init
Browse files Browse the repository at this point in the history
  • Loading branch information
airled committed May 3, 2016
1 parent 1212175 commit 6e1d093
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 11 deletions.
4 changes: 3 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ group :development, :test do
end

group :production do
gem 'unicorn'
# gem 'unicorn'
gem 'whenever'
gem 'thin'
end

20 changes: 12 additions & 8 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ GEM
timers (>= 4.1.1)
celluloid-supervision (0.20.5)
timers (>= 4.1.1)
chronic (0.10.2)
coderay (1.1.0)
coffee-rails (4.1.0)
coffee-script (>= 2.2.0)
Expand All @@ -114,6 +115,7 @@ GEM
colorize (0.7.7)
connection_pool (2.2.0)
curb (0.8.8)
daemons (1.2.3)
debug_inspector (0.0.2)
devise (3.5.2)
bcrypt (~> 3.0)
Expand All @@ -123,6 +125,7 @@ GEM
thread_safe (~> 0.1)
warden (~> 1.2.3)
erubis (2.7.0)
eventmachine (1.2.0.1)
execjs (2.6.0)
foreman (0.78.0)
thor (~> 0.19.1)
Expand Down Expand Up @@ -154,7 +157,6 @@ GEM
kaminari (0.16.3)
actionpack (>= 3.0.0)
activesupport (>= 3.0.0)
kgio (2.9.3)
libv8 (3.16.14.11)
loofah (2.0.3)
nokogiri (>= 1.5.9)
Expand Down Expand Up @@ -209,7 +211,6 @@ GEM
activesupport (= 4.2.1)
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
raindrops (0.15.0)
rake (10.4.2)
ransack (1.7.0)
actionpack (>= 3.0)
Expand Down Expand Up @@ -265,6 +266,10 @@ GEM
therubyracer (0.12.2)
libv8 (~> 3.16.14.0)
ref
thin (1.6.4)
daemons (~> 1.0, >= 1.0.9)
eventmachine (~> 1.0, >= 1.0.4)
rack (~> 1.0)
thor (0.19.1)
thread_safe (0.3.5)
tilt (1.4.1)
Expand All @@ -282,17 +287,15 @@ GEM
uglifier (2.7.1)
execjs (>= 0.3.0)
json (>= 1.8.0)
unicorn (4.9.0)
kgio (~> 2.6)
rack
raindrops (~> 0.7)
warden (1.2.3)
rack (>= 1.0)
web-console (2.2.1)
activemodel (>= 4.0)
binding_of_caller (>= 0.7.2)
railties (>= 4.0)
sprockets-rails (>= 2.0, < 4.0)
whenever (0.9.4)
chronic (>= 0.6.3)

PLATFORMS
ruby
Expand Down Expand Up @@ -326,11 +329,12 @@ DEPENDENCIES
slim
spring
therubyracer
thin
turbolinks
twitter-bootstrap-rails
uglifier (>= 1.3.0)
unicorn
web-console (~> 2.0)
whenever

BUNDLED WITH
1.11.2
1.12.1
20 changes: 18 additions & 2 deletions config/deploy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,34 @@
end
end

# task :start do
# on roles(:all) do
# within "#{fetch(:deploy_to)}/current/" do
# execute 'source ~/.zshrc && cd current && bundle exec unicorn -c config/unicorn.rb -E production -D && echo "Unicorn started"'
# end
# end
# end

# task :stop do
# on roles(:all) do
# within "#{fetch(:deploy_to)}/current/" do
# execute "pid=$(cat #{fetch(:deploy_to)}/current/tmp/pids/unicorn.pid) && kill -9 $(echo $pid) && echo 'Unicorn killed'"
# end
# end
# end

task :start do
on roles(:all) do
within "#{fetch(:deploy_to)}/current/" do
execute 'source ~/.zshrc && cd current && bundle exec unicorn -c config/unicorn.rb -E production -D && echo "Unicorn started"'
execute 'source ~/.zshrc && cd current && bundle exec thin -C config/thin.yml -R config.ru start && echo "Started"'
end
end
end

task :stop do
on roles(:all) do
within "#{fetch(:deploy_to)}/current/" do
execute "pid=$(cat #{fetch(:deploy_to)}/current/tmp/pids/unicorn.pid) && kill -9 $(echo $pid) && echo 'Unicorn killed'"
execute "source ~/.zshrc && cd current && bundle exec thin stop && echo 'Stopped'"
end
end
end
Expand Down
11 changes: 11 additions & 0 deletions config/thin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
address: 127.0.0.1