-
Notifications
You must be signed in to change notification settings - Fork 483
Setup task should not be trying to chown or chmod #278
Description
The setup task should just attempt to create the require directory structure. It is perfectly possible for the deploy user to be able to create the directories but not be permitted to run chmod/chown on them. However, if the user can create the directory structure successfully what is the need for chmod/chown to be run in the first place?
The way these commands are structure is founded on far too many assumptions. Here are the relevant lines from mina/deploy.rb.
#{echo_cmd %{chown -R `whoami` "#{deploy_to}"}} &&
#{echo_cmd %{chmod g+rx,u+rwx "#{deploy_to}"}} &&
These commands assume that:
- The deploy folder and all its subfolders must be owned by the deploying user.
- The group, which is neither defined nor managed by the setup task, must have read and execute permissions.
These assumptions are deeply flawed and I would argue that folder permissions fall well outside the purview of a deployment tool's responsibility. They should already be configured by a system provisioning tool as part of the system architecture.
For my purposes I had to clear out all of the default setup actions in order to write a sane setup script.