markomarkovic / simple-php-git-deploy

Automatically deploy the code using PHP and Git

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Script changes directory owner

mcki0127 opened this issue · comments

I have been using this deploy script for some time now without issue. But it just started changing the group ownership of the target directory from psaserv to psacln.

Incidentally, this was right after a second contributor to the repository pushed his changes. I don't understand how that should effect it though.

Any thoughts?

The only part of the code that could do that is the rsync command. Try removing g (preserve group) and/or o (preserve owner) flags from it, so it looks like this: rsync -rltDzvO %s %s %s %s and test whether it still happens.

If that doesn't work, you can add a post-deployment step here, something like $commands[] = sprintf('chown -R youruser:yourgroup %s', TARGET_DIR); should do the job.

I'm getting an "operation is not permitted" with the post-deployment command. Perhaps because the script is inside the folder it is trying to change? I'm not sure. I'll have to tinker around with this a bit to resolve. Thanks for the tip!

Actually, removing the g and o flags did the trick. Thanks again.