-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
Capistrano::Configuration.instance.load do | ||
after "deploy", "sidekiq:restart" | ||
|
||
namespace :sidekiq do | ||
|
||
desc "Force stop sidekiq" | ||
task :kill do | ||
run "cd #{current_path} && kill `cat tmp/pids/sidekiq.pid` && sleep 5 && kill -9 `cat tmp/pids/sidekiq.pid`" | ||
end | ||
|
||
desc "Stop sidekiq" | ||
task :stop do | ||
run "cd #{current_path} && kill `cat tmp/pids/sidekiq.pid`" | ||
end | ||
|
||
desc "Start sidekiq" | ||
task :start do | ||
rails_env = fetch(:rails_env, "production") | ||
run "cd #{current_path} && bundle exec sidekiq -e #{rails_env} -C config/sidekiq.yml -P tmp/pids/sidekiq.pid >> log/sidekiq.log &" | ||
end | ||
|
||
desc "Restart sidekiq" | ||
task :restart do | ||
stop | ||
start | ||
end | ||
|
||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
load 'deploy' | ||
# Uncomment if you are using Rails' asset pipeline | ||
# load 'deploy/assets' | ||
Dir['vendor/gems/*/recipes/*.rb','vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) } | ||
load 'config/deploy' # remove this line to skip loading any of the default tasks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ gem 'rails', '3.2.1' | |
gem 'sqlite3' | ||
gem 'sidekiq', :path => '..' | ||
gem 'resque' | ||
gem 'capistrano' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
require 'bundler/capistrano' | ||
require 'sidekiq/capistrano' | ||
|
||
set :scm, :git | ||
set :repository, '[email protected]:mperham/sidekiq' | ||
ssh_options[:forward_agent] = true | ||
|
||
default_run_options[:pty] = true # needed to run sudo | ||
set :user, 'mperham' | ||
set :application, "myapp" | ||
set :deploy_via, :remote_cache | ||
|
||
role :web, "localhost" | ||
role :app, "localhost" | ||
role :db, "localhost", :primary => true |