lib/capistrano/tasks/nginx-unit.rake in capistrano-nginx-unit-0.6.2 vs lib/capistrano/tasks/nginx-unit.rake in capistrano-nginx-unit-0.7.0
- old
+ new
@@ -7,10 +7,11 @@
set :nginx_unit_processes, -> { nil }
set :nginx_unit_user, -> { nil }
set :nginx_unit_group, -> { nil }
set :nginx_unit_working_dir, -> { nil }
set :nginx_unit_script, -> { "config.ru" }
+ set :nginx_unit_environment, -> { {} }
end
end
namespace :nginx_unit do
# NOTE: Should we detach listener and application before stopping?
@@ -54,11 +55,12 @@
type: "ruby",
processes: fetch(:nginx_unit_processes),
user: fetch(:nginx_unit_user),
group: fetch(:nginx_unit_group),
working_directory: fetch(:nginx_unit_working_dir) || released_dir,
- script: File.join(released_dir, fetch(:nginx_unit_script))
- }.reject { |_, v| v.nil? })
+ script: File.join(released_dir, fetch(:nginx_unit_script)),
+ environment: fetch(:nginx_unit_environment)
+ }.reject { |_, v| v.respond_to?(:empty?) ? v.empty? : v.nil? })
control_nginx_unit(:put, path: "/applications/#{fetch(:nginx_unit_app_name)}", json: app_json)
end
end