Skip to content

Instantly share code, notes, and snippets.

@jeroenr
Created April 5, 2012 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeroenr/2311229 to your computer and use it in GitHub Desktop.
Save jeroenr/2311229 to your computer and use it in GitHub Desktop.
Capistrano deploy:setup task without root permission
namespace :deploy do
task :setup, :except => { :no_release => true } do
dirs = [deploy_to, releases_path, shared_path]
dirs += shared_children.map { |d| File.join(shared_path, d.split('/').last) }
run "mkdir -p #{dirs.join(' ')}"
run "chmod g+w #{dirs.join(' ')}" if fetch(:group_writable, true)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment