use_sudo option in multistage

186 views
Skip to first unread message

Bryan Richardson

unread,
Dec 5, 2009, 6:02:56 PM12/5/09
to Capistrano
Hi All,

Does :use_sudo work in multistage? I have a production stage that runs
on a server requiring sudo, but a staging stage that runs on a
different server not requiring sudo. I tried "set :use_sudo, false" in
my config/deploy/staging.rb file, but it looks like Capistrano is
still trying to execute some commands on the staging server using
sudo...

Any ideas?!

--
Thanks!
Bryan

Lee Hambley

unread,
Dec 5, 2009, 6:03:48 PM12/5/09
to capis...@googlegroups.com
Bryan,

Can you post said files as requested in the group notes.

-- Lee Hambley

Twitter: @leehambley | @capistranorb

Bryan Richardson

unread,
Dec 5, 2009, 7:15:38 PM12/5/09
to Capistrano
Sorry...

"ruby --version" => ruby 1.8.7 (2009-06-12 patchlevel 174) [i486-
linux]
"cap --version" => Capistrano v2.5.10

Rails environment:
Ruby version 1.8.7 (i486-linux)
RubyGems version 1.3.5
Rack version 1.0
Rails version 2.3.2
Active Record version 2.3.2
Action Pack version 2.3.2
Active Resource version 2.3.2
Action Mailer version 2.3.2
Active Support version 2.3.2
Environment development

The significant parts of the deploy config files are as follows:
config/deploy.rb:

after "deploy:symlink_file_space", "deploy:update_crontab"

namespace :deploy do
desc "Update the crontab file"
task :update_crontab, :roles => :db do
run "cd #{release_path} && whenever --update-crontab #
{application}"
end
end

config/deploy/staging.rb:

set :use_sudo, false

The staging server I'm using doesn't allow me to run anything as sudo,
so I set :use_sudo to false. However, when I deploy to the staging
server and it attempts to run the :update_crontab task above it tries
to run it as sudo...

Thanks for the help!

--
Bryan

Lee Hambley

unread,
Jan 7, 2010, 5:23:56 AM1/7/10
to capis...@googlegroups.com
Bryan, was this ever resolved?
Reply all
Reply to author
Forward
0 new messages