Google Groups Home
Help | Sign in
Capistrano group and file permission best practices
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
David Rice  
View profile
 More options Oct 27 2006, 9:31 am
From: David Rice <davidjr...@gmail.com>
Date: Fri, 27 Oct 2006 14:31:57 +0100
Local: Fri, Oct 27 2006 9:31 am
Subject: Capistrano group and file permission best practices

Hi there,

In work we were discussing the issues we occasionally come across  
with deployments using capistrano, and wondered if there are any best  
practices to solve them.

We are getting problems with Group and File permissions that we're  
solving with the following two tasks... however we want to move to a  
single deployment user that can be shared across the development  
team, and we don't want to give that user sudo access. Any ideas out  
there?

Group Permissions
We have found that when deploying applications that a lot of the  
permission errors can be fixed by running the following;

desc "Change group to www-data"
task :chown_to_www-data, :roles => [ :app, :db, :web ] do
        sudo "chown -R #{user}:www-data #{deploy_to}"
end

File Permissions
We have problems with the following folders, which are in subversion  
(with their contents ignored).

#{current_path}/tmp
#{current_path}/log
#{current_path}/public/system

desc "Fix file permissions"
task :fix_file_permissions, :roles => [ :app, :db, :web ] do
        sudo "chmod -R g+rw #{current_path}/tmp"
        sudo "chmod -R g+rw #{current_path}/log"
        sudo "chmod -R g+rw #{current_path}/public/system"
end

Best,
David Rice


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jamis Buck  
View profile
 More options Oct 27 2006, 10:41 am
From: Jamis Buck <ja...@37signals.com>
Date: Fri, 27 Oct 2006 08:41:33 -0600
Local: Fri, Oct 27 2006 10:41 am
Subject: Re: [Capistrano] Capistrano group and file permission best practices

David,

The next release of Capistrano will do "chmod -R g+w" on the new  
release during the update_code task, which should fix group  
permissions issues. Regarding the second set of directories you  
indicated, those directories are all explicitly removed and then  
symlinked by Capistrano on each deploy. You should be able to fix  
your permission issues once by chmoding the #{shared_path} and its  
contents. After that, they won't change, since the shared directory  
is not touched by the deploy process.

- Jamis

On Oct 27, 2006, at 7:31 AM, David Rice wrote:

  smime.p7s
3K Download

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google