From d8026414c8bf671ad8f600fb8fc91c0f8912185c Mon Sep 17 00:00:00 2001 From: Stafford Brunk Date: Wed, 30 Sep 2015 17:31:05 -0400 Subject: [PATCH] Add default sidekiq_user value + documentation --- README.md | 1 + lib/capistrano/tasks/capistrano2.rb | 2 ++ lib/capistrano/tasks/sidekiq.rake | 1 + 3 files changed, 4 insertions(+) diff --git a/README.md b/README.md index 6420a3c..e0892b0 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,7 @@ Configurable options, shown here with defaults: :sidekiq_monit_use_sudo => true :sidekiq_cmd => "#{fetch(:bundle_cmd, "bundle")} exec sidekiq" # Only for capistrano2.5 :sidekiqctl_cmd => "#{fetch(:bundle_cmd, "bundle")} exec sidekiqctl" # Only for capistrano2.5 + :sidekiq_user => nil #user to run sidekiq as ``` There is a known bug that prevents sidekiq from starting when pty is true on Capistrano 3. diff --git a/lib/capistrano/tasks/capistrano2.rb b/lib/capistrano/tasks/capistrano2.rb index 4d57dde..6888f07 100644 --- a/lib/capistrano/tasks/capistrano2.rb +++ b/lib/capistrano/tasks/capistrano2.rb @@ -21,6 +21,8 @@ _cset(:sidekiq_processes) { 1 } _cset(:sidekiq_options_per_process) { nil } + _cset(:sidekiq_user) { nil } + if fetch(:sidekiq_default_hooks) before 'deploy:update_code', 'sidekiq:quiet' after 'deploy:stop', 'sidekiq:stop' diff --git a/lib/capistrano/tasks/sidekiq.rake b/lib/capistrano/tasks/sidekiq.rake index 62610ec..45c1657 100644 --- a/lib/capistrano/tasks/sidekiq.rake +++ b/lib/capistrano/tasks/sidekiq.rake @@ -9,6 +9,7 @@ namespace :load do set :sidekiq_role, -> { :app } set :sidekiq_processes, -> { 1 } set :sidekiq_options_per_process, -> { nil } + set :sidekiq_user, -> { nil } # Rbenv and RVM integration set :rbenv_map_bins, fetch(:rbenv_map_bins).to_a.concat(%w(sidekiq sidekiqctl)) set :rvm_map_bins, fetch(:rvm_map_bins).to_a.concat(%w(sidekiq sidekiqctl))