Commit cb4b3a5

mo khan <mo@mokhan.ca>
2015-05-24 04:23:50
specify permissions for capistrano folder.
1 parent cfc866e
Changed files (1)
recipes/capistrano.rb
@@ -11,8 +11,9 @@ directories = [
   "#{shared_path}/bundle",
   "#{shared_path}/config",
   "#{shared_path}/log",
-  "#{shared_path}/pids",
-  "#{shared_path}/sockets",
+  "#{shared_path}/tmp/sockets",
+  "#{shared_path}/tmp/pids",
+  "#{shared_path}/tmp/cache",
   "#{root_path}/releases",
 ]
 
@@ -34,6 +35,13 @@ template "#{shared_path}/.env.#{node.chef_environment}" do
   variables(configuration)
 end
 
+execute "chown-rails" do
+  command "chown -R rails:rails #{root_path}"
+  user "root"
+  action :run
+  not_if "stat -c %U #{root_path} | grep root"
+end
+
 template "#{shared_path}/config/database.yml" do
   source "database.yml.erb"
   mode "0664"