Skip to content
This repository was archived by the owner on May 14, 2021. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion lib/poise_application_ruby/resources/unicorn.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ class Resource < Chef::Resource
# @!attribute port
# Port to bind to.
attribute(:port, kind_of: [String, Integer], default: 80)
attribute(:config_path, kind_of: String)
end

# Provider for `application_unicorn`.
Expand Down Expand Up @@ -79,7 +80,10 @@ def configru_path
# Set service resource options.
def service_options(resource)
super
resource.ruby_command("unicorn --port #{new_resource.port} #{configru_path}")
cmd = "unicorn --port #{new_resource.port}"
cmd << " --config-file #{::File.expand_path(new_resource.config_path, new_resource.path)}" if new_resource.config_path
cmd << " #{configru_path}"
resource.ruby_command(cmd)
end
end
end
Expand Down