Skip to content

Instantly share code, notes, and snippets.

@cordoval
Forked from shaneog/update_acl.rb
Created September 25, 2011 05:28
Show Gist options
  • Save cordoval/1240271 to your computer and use it in GitHub Desktop.
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
# 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