-
-
Save cordoval/1240271 to your computer and use it in GitHub Desktop.
Capifony Task to Set ACLs on Symfony2 app/cache and app/logs directories as per http://symfony.com/doc/current/book/installation.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Change ACL on the app/logs and app/cache directories | |
after 'deploy', 'deploy:update_acl' | |
# This is a custom task to set the ACL on the app/logs and app/cache directories | |
namespace :deploy do | |
task :update_acl, :roles => :app do | |
shared_dirs = [ | |
app_path + "/logs", | |
app_path + "/cache" | |
] | |
# add group write permissions | |
#run "chmod -R g+w #{shared_dirs.join(' ')}" | |
# Allow directories to be writable by webserver and this user | |
run "cd #{latest_release} && sudo setfacl -R -m u:www-data:rwx -m u:#{user}:rwx #{shared_dirs.join(' ')}" | |
run "cd #{latest_release} && sudo setfacl -dR -m u:www-data:rwx -m u:#{user}:rwx #{shared_dirs.join(' ')}" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment