You can edit /etc/sudoers on your linux box and add:
deploy_username ALL=(ALL) NOPASSWD: ALL
--
Jochen
sudo("cd /path/to/something && do_something")
In cap 2.2 and earlier that wouldn't work, because only the first
command would execute as sudo, but not the latter. Cap 2.3 silently
wraps your command in an sh -e "..." invocation...which (duh) breaks
when you've got sudo configured to only execute certain commands. I'll
be rolling this back in the next release, but this also means that
deploy:setup won't use sudo (again), because it currently does "umask
0220 && mkdir", which breaks with the older sudo model.
I'm open to suggestions on this. These kinds of regressions are really
demotivating for me. :(
- Jamis
> --~--~---------~--~----~------------~-------~--~----~
> To unsubscribe from this group, send email to capistrano-...@googlegroups.com
> For more options, visit this group at http://groups.google.com/group/capistrano
> -~----------~----~----~----~------~----~------~--~---
>
-------------- Original message from Jamis Buck <ja...@37signals.com>: --------------
- Jamis
if [ -x /path/to/something ]; then cd /path/to; something; fi
First of all, you can't do "sudo if [...] ... fi", because "if" isn't
a command, it's shell syntax. You either need to do "sudo sh -e '...'"
or you do "if [...]; then sudo cd /path/to; sudo something; fi".
Basically, I don't know that there is a good way to do this generally.
Maybe cap just needs to expose a simple way to "inject" sudo into
commands...
- Jamis
- Jamis
run "#{sudo} something && #{sudo} something else"
In other words, the sudo() helper, if called without arguments (or with
only a hash of options) will return the command needed to invoke sudo.
Otherwise, it works as it always had.
http://github.com/jamis/capistrano/commit/b45290e6ae3acce465ab5b7b8a82b7ad73a022e3
- Jamis