lib/capistrano/tasks/nginx.rake in capistrano3-nginx-3.0.2 vs lib/capistrano/tasks/nginx.rake in capistrano3-nginx-3.0.3
- old
+ new
@@ -57,11 +57,13 @@
desc 'Compress JS and CSS with gzip'
task :gzip_static => ['nginx:load_vars'] do
on release_roles fetch(:nginx_roles) do
within release_path do
- execute :find, "'#{fetch(:nginx_static_dir)}' -type f -name '*.js' -o -name '*.css' -exec gzip -v -9 -f -k {} \\;"
+ arguments = :find, "'#{fetch(:nginx_static_dir)}' -type f -name '*.js' -o -name '*.css' -exec gzip -v -9 -f -k {} \\;"
+ git_plugin.add_sudo_if_required arguments, :gzip_static
+ execute *arguments, interaction_handler: PasswdInteractionHandler.new
end
end
end
namespace :site do
@@ -69,17 +71,17 @@
task :add => ['nginx:load_vars', 'nginx:validate_user_settings'] do
on release_roles fetch(:nginx_roles) do
within fetch(:sites_available) do
config_file = fetch(:nginx_template)
if config_file == :default
- config_file = File.expand_path('../../../../templates/nginx.conf.erb', __FILE__)
+ config_file = File.expand_path('../../../../templates/nginx.conf.erb', __FILE__)
end
config = ERB.new(File.read(config_file)).result(binding)
upload! StringIO.new(config), '/tmp/nginx.conf'
arguments = :mv, '/tmp/nginx.conf', fetch(:nginx_application_name)
git_plugin.add_sudo_if_required arguments, 'nginx:sites:add', :nginx_sites_available_dir
- execute *arguments
+ execute *arguments, interaction_handler: PasswdInteractionHandler.new
end
end
end
desc 'Enables the site creating a symbolic link into the enabled folder'
@@ -87,11 +89,11 @@
on release_roles fetch(:nginx_roles) do
if test "! [ -h #{fetch(:enabled_application)} ]"
within fetch(:sites_enabled) do
arguments = :ln, '-nfs', fetch(:available_application), fetch(:enabled_application)
git_plugin.add_sudo_if_required arguments, 'nginx:sites:enable', :nginx_sites_enabled_dir
- execute *arguments
+ execute *arguments, interaction_handler: PasswdInteractionHandler.new
end
end
end
end
@@ -100,11 +102,11 @@
on release_roles fetch(:nginx_roles) do
if test "[ -f #{fetch(:enabled_application)} ]"
within fetch(:sites_enabled) do
arguments = :rm, '-f', fetch(:nginx_application_name)
git_plugin.add_sudo_if_required arguments, 'nginx:sites:disable', :nginx_sites_enabled_dir
- execute *arguments
+ execute *arguments, interaction_handler: PasswdInteractionHandler.new
end
end
end
end
@@ -113,10 +115,10 @@
on release_roles fetch(:nginx_roles) do
if test "[ -f #{fetch(:available_application)} ]"
within fetch(:sites_available) do
arguments = :rm, fetch(:nginx_application_name)
git_plugin.add_sudo_if_required arguments, 'nginx:sites:remove', :nginx_sites_available_dir
- execute *arguments
+ execute *arguments, interaction_handler: PasswdInteractionHandler.new
end
end
end
end
end