From 28c89338f86dd72e11b4bd280087e5cda9bf5cd7 Mon Sep 17 00:00:00 2001 From: Bruno Zanchet Date: Thu, 19 Apr 2012 18:13:23 -0300 Subject: [PATCH] using the bundle_cmd variable on capistrano tasks if present --- lib/sidekiq/capistrano.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/sidekiq/capistrano.rb b/lib/sidekiq/capistrano.rb index db1f2f53..dce344c9 100644 --- a/lib/sidekiq/capistrano.rb +++ b/lib/sidekiq/capistrano.rb @@ -11,18 +11,18 @@ Capistrano::Configuration.instance.load do desc "Quiet sidekiq (stop accepting new work)" task :quiet, :roles => lambda { fetch(:sidekiq_role) } do - run "cd #{current_path} && if [ -f #{current_path}/tmp/pids/sidekiq.pid ]; then bundle exec sidekiqctl quiet #{current_path}/tmp/pids/sidekiq.pid ; fi" + run "cd #{current_path} && if [ -f #{current_path}/tmp/pids/sidekiq.pid ]; then #{fetch(:bundle_cmd, "bundle")} exec sidekiqctl quiet #{current_path}/tmp/pids/sidekiq.pid ; fi" end desc "Stop sidekiq" task :stop, :roles => lambda { fetch(:sidekiq_role) } do - run "cd #{current_path} && if [ -f #{current_path}/tmp/pids/sidekiq.pid ]; then bundle exec sidekiqctl stop #{current_path}/tmp/pids/sidekiq.pid #{fetch :sidekiq_timeout} ; fi" + run "cd #{current_path} && if [ -f #{current_path}/tmp/pids/sidekiq.pid ]; then #{fetch(:bundle_cmd, "bundle")} exec sidekiqctl stop #{current_path}/tmp/pids/sidekiq.pid #{fetch :sidekiq_timeout} ; fi" end desc "Start sidekiq" task :start, :roles => lambda { fetch(:sidekiq_role) } do rails_env = fetch(:rails_env, "production") - run "cd #{current_path} ; nohup bundle exec sidekiq -e #{rails_env} -C #{current_path}/config/sidekiq.yml -P #{current_path}/tmp/pids/sidekiq.pid >> #{current_path}/log/sidekiq.log 2>&1 &", :pty => false + run "cd #{current_path} ; nohup #{fetch(:bundle_cmd, "bundle")} exec sidekiq -e #{rails_env} -C #{current_path}/config/sidekiq.yml -P #{current_path}/tmp/pids/sidekiq.pid >> #{current_path}/log/sidekiq.log 2>&1 &", :pty => false end desc "Restart sidekiq"