Cleanup launchd exporter

Also suppresses the deprecation warning for the launchd exporter when
using port instead of engine.port_for
This commit is contained in:
Aaron Kalin
2012-09-10 18:21:51 -05:00
parent f6d4badcd2
commit c617ddb3b2
4 changed files with 9 additions and 12 deletions

View File

@@ -6,10 +6,10 @@
<string><%= "#{app}-#{name}-#{num}" %></string>
<key>EnvironmentVariables</key>
<dict>
<% engine.env.merge("PORT" => port).each_pair do |var,env| %>
<key><%= var.upcase %></key>
<string><%= env %></string>
<% end %>
<%- engine.env.merge("PORT" => port).each_pair do |var,env| -%>
<key><%= var.upcase %></key>
<string><%= env %></string>
<%- end -%>
</dict>
<key>ProgramArguments</key>
<array>

View File

@@ -7,6 +7,7 @@ class Foreman::Export::Launchd < Foreman::Export::Base
super
engine.each_process do |name, process|
1.upto(engine.formation[name]) do |num|
port = engine.port_for(process, num)
write_template "launchd/launchd.plist.erb", "#{app}-#{name}-#{num}.plist", binding
end
end

View File

@@ -6,10 +6,8 @@
<string>app-alpha-1</string>
<key>EnvironmentVariables</key>
<dict>
<key>PORT</key>
<string>5000</string>
<key>PORT</key>
<string>5000</string>
</dict>
<key>ProgramArguments</key>
<array>

View File

@@ -6,10 +6,8 @@
<string>app-bravo-1</string>
<key>EnvironmentVariables</key>
<dict>
<key>PORT</key>
<string>5000</string>
<key>PORT</key>
<string>5100</string>
</dict>
<key>ProgramArguments</key>
<array>