添加 sidekiq 的布署脚本

This commit is contained in:
yafeilee 2014-04-03 00:01:25 +08:00
parent 369184d4f1
commit 193a96d055
5 changed files with 22 additions and 1 deletions

3
.gitignore vendored
View File

@ -18,6 +18,7 @@
/public/uploads/*
/config/*.yml
/config/application.yml
/config/mongoid.yml
/public/assets/*
*.old

View File

@ -29,6 +29,7 @@ gem 'figaro'
gem 'rqrcode-with-patches', require: 'rqrcode'
gem 'chunky_png'
gem 'sidekiq'
gem 'mina-sidekiq'
gem 'rest-client'
group :development do

View File

@ -113,6 +113,11 @@ GEM
treetop (~> 1.4.8)
method_source (0.8.2)
mime-types (1.25.1)
mina (0.3.0)
open4
rake
mina-sidekiq (0.3.0)
mina
mini_magick (3.7.0)
subexec (~> 0.2.1)
mini_portile (0.5.3)
@ -140,6 +145,7 @@ GEM
nio4r (1.0.0)
nokogiri (1.6.1)
mini_portile (~> 0.5.0)
open4 (1.3.3)
optionable (0.2.0)
origin (2.1.0)
polyglot (0.3.4)
@ -271,6 +277,7 @@ DEPENDENCIES
guard-rspec
html_truncator
jquery-rails
mina-sidekiq
mini_magick
mongoid
mongoid-pagination

View File

@ -2,6 +2,7 @@ require 'mina/bundler'
require 'mina/rails'
require 'mina/git'
require 'mina/rvm' # for rvm support. (http://rvm.io)
require 'mina_sidekiq/tasks'
set :domain, 'yafeilee.me'
set :deploy_to, '/home/ruby/wblog'
@ -37,6 +38,7 @@ task :deploy => :environment do
deploy do
# Put things that will set up an empty directory into a fully set-up
# instance of your project.
invoke :'sidekiq:quiet'
invoke :'git:clone'
invoke :'deploy:link_shared_paths'
invoke :'bundle:install'
@ -45,6 +47,7 @@ task :deploy => :environment do
to :launch do
invoke :'unicorn:restart'
invoke :'sidekiq:restart'
end
end
end

9
config/sidekiq.yml Normal file
View File

@ -0,0 +1,9 @@
---
:concurrency: 2
:pidfile: tmp/pids/sidekiq.pid
staging:
:concurrency: 10
production:
:concurrency: 20
:queues:
- default