Reputation: 3388
I have a problem deploying a Rails app to my server. Performing a
cap deploy
I get lots of errors, stating that chmod is not able to change permissions of (and only of) git object files:
...
** [out :: ██████████████] chmod: changing permissions of `/srv/www/kunsthof/releases/20101113162736/.git/objects/04/779c6d894bbea4c26d6e035f71cd1ab124cc90': Operation not permitted
...
failed: "sh -c 'chmod -R g+w /srv/www/kunsthof/releases/20101113162736'" on ██████████████
The files are put there on the deploy itself, so it should be possible for the deploy user to change their permissions. Any suggestions on what could be the problem here?
Upvotes: 3
Views: 3643
Reputation: 655
Usually on deploy if you are using cached-copy, your repo will be cloned to a shared directory and will be rsynced/copied to the current release directory. While coping, you should be excluding .git directory and other unnecessary directories like spec / test (which are not going to used in production) with the following variable:
set :copy_exclude, [".git", "spec"]
With this, you are not going to copy the .git directory and should not be facing the permission problem on doing chmod there after.
Upvotes: 4