1

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

Pavel K.
  • 6,697
  • 8
  • 49
  • 80

2 Answers2

2

Using the sudo helper solved the problem.
Here is an example:

run "#{sudo} chown root:root /etc/my.cnf"
Marius Butuc
  • 17,781
  • 22
  • 77
  • 111
Pavel K.
  • 6,697
  • 8
  • 49
  • 80
  • 1
    Don't leave us hanging! What is "sudo helper"? I can't find references to it in the Capistrano docs. – Mojo Apr 10 '12 at 21:02
  • explained here: http://stackoverflow.com/questions/431925/capistrano-is-hanging-when-prompting-for-sudo-password-to-an-ubuntu-box (note the comment about deprecation and new format) – Pavel K. Apr 11 '12 at 22:10
0

Try cap deploy:setup

Lee Hambley
  • 6,270
  • 5
  • 49
  • 81