forked from mdespuits/capistrano-recipes
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathsetup.rb
More file actions
22 lines (16 loc) · 625 Bytes
/
setup.rb
File metadata and controls
22 lines (16 loc) · 625 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
namespace :deploy do
desc <<-DESC
Change ownership of the created directories to user '#{user}'.
Execute at the setup stage to the application deployment user. Run
this after deploy:setup task.
Source: #{path_to __FILE__}
DESC
task :chown_dirs, :except => { :no_release => true } do
dirs = [deploy_to, releases_path, shared_path]
dirs += shared_children.map { |d| File.join(shared_path, d.split('/').last) }
sudo "chown -R #{user} #{dirs.join(' ')}" if user
end
end
after "deploy:setup", "deploy:chown_dirs"
before "database:setup", "deploy:chown_dirs"
before "unicorn:setup", "deploy:chown_dirs"