Skip to content

Commit

Permalink
Make sidekiq_user optional in cap2 task like it is in cap3
Browse files Browse the repository at this point in the history
  • Loading branch information
wingrunr21 committed Sep 30, 2015
1 parent d802641 commit a1f67ed
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/capistrano/tasks/capistrano2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,12 @@ def for_each_role
end

def run_as(cmd)
opts = {
roles: sidekiq_role
}
su_user = fetch(:sidekiq_user)
run cmd, roles: sidekiq_role, shell: "su - #{su_user}"
opts[:shell] = "su - #{su_user}" if su_user
run cmd, opts
end

def quiet_process(pid_file, idx, sidekiq_role)
Expand Down

0 comments on commit a1f67ed

Please sign in to comment.