1
0
Fork 0
mirror of https://github.com/capistrano/capistrano synced 2023-03-27 23:21:18 -04:00

use the :runner variable to determine who to sudo as for deploy:restart (closes #9212)

git-svn-id: http://svn.rubyonrails.org/rails/tools/capistrano@7374 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
Jamis Buck 2007-08-30 14:01:33 +00:00
parent 642614ee08
commit db1a850915
2 changed files with 12 additions and 6 deletions

View file

@ -1,5 +1,7 @@
*SVN*
* Use the :runner variable to determine who to sudo as for deploy:restart [Graham Ashton]
* Add Namespaces#top to always return a reference to the topmost namespace [Jamis Buck]
* Change the "-h" output so that it does not say that "-q" is the default [Jamis Buck]

View file

@ -230,15 +230,19 @@ namespace :deploy do
desc <<-DESC
Restarts your application. This works by calling the script/process/reaper \
script under the current path. By default, this will be invoked via sudo, \
but if you are in an environment where sudo is not an option, or is not \
allowed, you can indicate that restarts should use `run' instead by \
setting the `use_sudo' variable to false:
script under the current path.
By default, this will be invoked via sudo as the `app' user. If \
you wish to run it as a different user, set the :runner variable to \
that user. If you are in an environment where you can't use sudo, set \
the :use_sudo variable to false:
set :use_sudo, false
DESC
task :restart, :roles => :app, :except => { :no_release => true } do
invoke_command "#{current_path}/script/process/reaper", :via => run_method
as = fetch(:runner, "app")
via = fetch(:run_method, :sudo)
invoke_command "#{current_path}/script/process/reaper", :via => via, :as => as
end
desc <<-DESC