使用capistrano部署会忽略组设置 [英] Deploying with capistrano does ignore group setting
问题描述
在我的部署文件中,将组设置为www-data:
set:user, root
set:group, www-data
所以使用cap:setup时,我希望capistrano可以用root:www-data
整理文件夹,但是所有文件夹和文件都是root:root。任何
信息:我正在使用system-wide-rvm。
以我的理解,您应该手动执行此操作,设置是
使用用户登录,而不是设置目录权限。
我没有发现capistrano的组设置,也许您正在使用一些扩展名?
您可以做些什么来改变它:
在 deploy:setup之后,:setup_group
任务:setup_group do
运行 chown- R:#{group}#{deploy_to}& chmod -R g + s#{deploy_to}
end
但是首先,您不应使用 root 进行部署,因为@Julian在评论中提到,更好的做法是使用单独的用户来完成此任务并将其组设置为适当的组,然后它不需要上述任务即可自动运行。
In my deploy-file I set the group to www-data:
set :user, "root"
set :group, "www-data"
so when using cap:setup I expected capistrano to chown the folders with root:www-data
But all folders and files are root:root.
Any ideas where this problem could come from?
Information: I'm Using system-wide-rvm.
as for my understanding you should do it manually, what setup does is to use the user to login, not to set the rights to directory.
I have found no group setting for capistrano, maybe you were using some extensions for it?
What you could do to change it could be:
after "deploy:setup", :setup_group
task :setup_group do
run "chown -R :#{group} #{deploy_to} && chmod -R g+s #{deploy_to}"
end
But in first place you should not use root for deployment, as @Julian mentions in comment better practice is to use separate user for this task and set his group to proper group, then it will not require the above task and will work automatically.
这篇关于使用capistrano部署会忽略组设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!