We keep running into permission issues after a deployment, and, while permissions are set correctly when creating the archive, it seems that they're not retained when extracting the archive.
I just thought I'd post here first before creating a PR, because I find it strange I'm only running into this issue now (after having used this for years).
It could be that I'm only running into this issue now because of different umask settings, and that most writable directories are shared between deployments anyway (and so setting perms once manually would fix it for good). On top of that, some directories don't need to be writable, such as vendor, pub/static (other than bug #13225) and app/etc, unless you're in developer mode and would like to change env.php through the admin).
We keep running into permission issues after a deployment, and, while permissions are set correctly when creating the archive, it seems that they're not retained when extracting the archive.
Permissions are set correctly here: https://github.com/jalogut/magento2-deployer-plus/blob/master/recipe/magento_2_1/files.php#L20
But are not retained here: https://github.com/jalogut/magento2-deployer-plus/blob/master/recipe/magento_2_2/artifact.php#L30
I think a
-p
flag is needed: https://www.gnu.org/software/tar/manual/html_node/Setting-Access-Permissions.html#SEC82I just thought I'd post here first before creating a PR, because I find it strange I'm only running into this issue now (after having used this for years).
It could be that I'm only running into this issue now because of different umask settings, and that most writable directories are shared between deployments anyway (and so setting perms once manually would fix it for good). On top of that, some directories don't need to be writable, such as vendor, pub/static (other than bug #13225) and app/etc, unless you're in developer mode and would like to change env.php through the admin).