capistrano deployment with use_sudo=true - permissions problem

Posted by Pavel K. on Stack Overflow See other posts from Stack Overflow or by Pavel K.
Published on 2009-12-17T18:09:28Z Indexed on 2010/04/21 7:53 UTC
Read the original article Hit count: 249

Filed under:

i am trying to do a deployment with capistrano to newly installed Ubuntu server

i am deploying to directory /var/www, owned by root, so i need to set use_sudo to true

while i execute commands with run "#{try_sudo} command" without problem, svn checkout doesn't work with sudo prefix

i try

set :deploy_via, :export

and it throws

Can't make directory '/var/www/pr_name/releases/20091217171253': Permission denied

during checkout

i imagine adding "try_sudo" prefix to "svn export" would help, but where can i edit the one it uses in deploy_via?

--

if on other hand i don't use use_sudo, and set /var/www/ directory ownership to myuser, i still cannot deploy - some of my deployment commands set folders ownership to apache user www-data and then i get something like:

changing ownership of `/var/www/pr_name/current/specificdirectory': Operation not permitted

which, if i understand correctly, has to be done with sudo

© Stack Overflow or respective owner

Related posts about capistrano