Deployer: Setting file owner (chown)?

Created on 16 May 2016  路  7Comments  路  Source: deployphp/deployer

| Q | A |
| --- | --- |
| Issue Type | Question |
| Deployer Version | N/A |
| Local Machine OS | N/A |
| Remote Machine OS | N/A |

Description

I noticed files are created under the account you use for authentication, but I need the files to have specific user/group, not same as SSH account. What is the best way to do this with Deployer?

Most helpful comment

If someone else gets stuck a quick workaround for this is to write a custom task, for example:

task('deploy:owner', function () {
  run('chown -R www-data:www-data /var/www/site');
});

Something built-in would be nice though, it's a very common feature.

All 7 comments

If someone else gets stuck a quick workaround for this is to write a custom task, for example:

task('deploy:owner', function () {
  run('chown -R www-data:www-data /var/www/site');
});

Something built-in would be nice though, it's a very common feature.

@khromov
Thank you for your idea. It is good, but it can have use root privilege. We will think about it.

What about writable?

@elfet I assume that chmods the files to be writable? I'm currently deploying a WordPress project and it doesn't play nice if the files are not owned by the web server process... The workaround task I have works well so you can consider adding native chown-capabilities a feature request!

Solved with v4.

But, how was it solved? Looking through the docs, have not found it yet.

Use run('chown ...')

Was this page helpful?
0 / 5 - 0 ratings

Related issues

krve picture krve  路  4Comments

ovaiskhan11 picture ovaiskhan11  路  4Comments

khoanguyen96 picture khoanguyen96  路  5Comments

JonasDoebertin picture JonasDoebertin  路  4Comments

antonmedv picture antonmedv  路  5Comments