当我这样做时bundle exec cap production deploy
,我收到了错误消息,例如mkdir: cannot create directory /usr/share/nginx/www/appname/releases/20131216155457: Permission denied
Capistrano3 没有set use_sudo
和default_run_options
。我读到 Passwordless sudo 更好,所以我做了 visudo username ALL=NOPASSWD:ALL
,但仍然遇到同样的错误。
set :application, 'appname.com'
set :repo_url, 'git@bitbucket.org:user/myapp.git'
set :user, 'username'
set :branch, 'master'
set :deploy_to, '/usr/share/nginx/www/appname'
set :keep_releases, 5
namespace :deploy do
desc 'Restart application'
task :restart do
on roles(:app), in: :sequence, wait: 5 do
end
end
after :restart, :clear_cache do
on roles(:web), in: :groups, limit: 3, wait: 10 do
end
end
after :finishing, 'deploy:cleanup'
end
有没有人给我任何关于这个问题的建议?谢谢您的帮助。