Setup task should not be trying to chown or chmod
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.
You can always write your own setup task, name it something else.
The setup as it is works for most of the people but you can write a PR and we can test it out.
I did one better; I wrote my own setup task and named it exactly the same. But I will probably not be writing a PR as I do not have the time for that and you do not seem to share my view on the limits of Mina's responsibility in deployment.
Cool, thanks. If anyone has the same problem he can contact you
No, he can't. Don't presume to advertise my availability on my behalf.
sorry to be digging an old and resolved issue, but @Bilge I just had the exact same problem and had you shared your solution to the problem, even if by only pasting it on this issue, would have been great right now
# Clear default Mina actions.
Rake::Task['setup'].clear_actions
task setup: :environment do
queue! %(mkdir -pv -- '#{deploy_to}')
queue! %(cd -Pe -- '#{deploy_to}')
queue! %(mkdir -pv -- '#{releases_path}' '#{shared_path}')
end
thanks a lot!