alistairstead/Magentify — pull request #1 by mattheath (2012-03-29 07:43:54+00:00)
Title: sudo chmod shared dirs/files when sudo is used to create them

Hi Alistair,

When I run `cap deploy:setup` the `mage:setup` task fails to change the permissions on the shared directories. This appears to be because mkdir runs with sudo, but chmod doesn't. The parent folder (/var/www/vhosts/) has permissions of 755 root:root, and the user has sudo privileges.

[server_name] executing command
[server_name] sh -c 'sudo -p '\''sudo password: '\'' mkdir -p /var/www/vhosts/magento-cap/shared/app/etc && chmod g+w /var/www/vhosts/magento-cap/shared/app/etc'
** [out :: server_name] chmod: changing permissions of `/var/www/vhosts/magento-cap/shared/app/etc': Operation not permitted
command finished in 449ms
failed: "sh -c 'sudo -p '\\''sudo password: '\\'' mkdir -p /var/www/vhosts/magento-cap/shared/app/etc && chmod g+w /var/www/vhosts/magento-cap/shared/app/etc'" on

I've modified the `:setup` task to use sudo when chmodding the shared folders which fixes the issue.