davidalger / capistrano-magento2

Magento 2 specific tasks for Capistrano 3
https://rubygems.org/gems/capistrano-magento2
Open Software License 3.0
228 stars 75 forks source link

Clarify documentation for magento_deploy_chmod* settings #131

Closed erikhansen closed 5 years ago

erikhansen commented 5 years ago

If the magento_deploy_chmod* settings are not quoted, any setting that begins with a 0 will not have the expected effect due to how Ruby handles integer conversion using the to_i method (run this for an example). This is where to_i is used in this Gem.

For example, if you add this setting in config/deploy.rb:

set :magento_deploy_chmod_f, 0660

Then the magento:setup:permissions command will use 432 instead of 660

find /var/www/stage.example.com/releases/20190828215809 -type f ! -perm 432 -exec chmod 432 {} +

But if you set the value as a string, it works as expected:

set :magento_deploy_chmod_f, '0660'
find /var/www/stage.example.com/releases/20190828215809 -type f ! -perm 660 -exec chmod 660 {} +
davidalger commented 5 years ago

Thanks for the contribution @erikhansen