Class: Foreman::Export::Launchd

Inherits:
Base
  • Object
show all
Defined in:
lib/foreman/export/launchd.rb

Instance Attribute Summary

Attributes inherited from Base

#engine, #formation, #location, #options, #port

Instance Method Summary collapse

Methods inherited from Base

#app, #initialize, #log, procfile, #run, #template, #user

Constructor Details

This class inherits a constructor from Foreman::Export::Base

Instance Method Details

#exportObject



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/foreman/export/launchd.rb', line 6

def export
  super
  engine.each_process do |name, process|
    1.upto(engine.formation[name]) do |num|
      port = engine.port_for(process, num)
      command_args = process.command.split(/\s+/).map{|arg|
        case arg
        when "$PORT" then port
        else arg
        end
      }
      write_template "launchd/launchd.plist.erb", "#{app}-#{name}-#{num}.plist", binding
    end
  end
end