Sha256: 7e9f6b761e6d89f3161d083872e4bac576e5e821d2f52e1f7e10a81c92e82c3e

Contents?: true

Size: 838 Bytes

Versions: 35

Compression:

Stored size: 838 Bytes

Contents

require "erb"
require "foreman/export"

class Foreman::Export::Daemon < Foreman::Export::Base

  def export
    super

    (Dir["#{location}/#{app}-*.conf"] << "#{location}/#{app}.conf").each do |file|
      clean file
    end

    write_template "daemon/master.conf.erb", "#{app}.conf", binding

    engine.each_process do |name, process|
      next if engine.formation[name] < 1
      write_template "daemon/process_master.conf.erb", "#{app}-#{name}.conf", binding

      1.upto(engine.formation[name]) do |num|
        port = engine.port_for(process, num)
        arguments = process.command.split(" ")
        executable = arguments.slice!(0)
        arguments = arguments.size > 0 ? " -- #{arguments.join(' ')}" : ""
        write_template "daemon/process.conf.erb", "#{app}-#{name}-#{num}.conf", binding
      end
    end
  end
end

Version data entries

35 entries across 35 versions & 4 rubygems

Version Path
foreman-0.88.1 lib/foreman/export/daemon.rb
overman-0.87.3 lib/foreman/export/daemon.rb
foreman-0.87.2 lib/foreman/export/daemon.rb
foreman-0.87.1 lib/foreman/export/daemon.rb
ypadlyak-foreman-0.85.0 lib/foreman/export/daemon.rb
ypadlyak-foreman-0.81.0 lib/foreman/export/daemon.rb
foreman-0.87.0 lib/foreman/export/daemon.rb
foreman-0.86.0 lib/foreman/export/daemon.rb
foreman-0.85.0 lib/foreman/export/daemon.rb
foreman-0.84.0 lib/foreman/export/daemon.rb
foreman-0.83.0 lib/foreman/export/daemon.rb
foreman-systemd-0.78.0 lib/foreman/export/daemon.rb
foreman-0.82.0 lib/foreman/export/daemon.rb
foreman-0.81.0 lib/foreman/export/daemon.rb
foreman-0.80.2 lib/foreman/export/daemon.rb
foreman-0.80.1 lib/foreman/export/daemon.rb
foreman-0.80.0 lib/foreman/export/daemon.rb
foreman-0.78.0 lib/foreman/export/daemon.rb
foreman-0.77.0 lib/foreman/export/daemon.rb
foreman-0.76.0 lib/foreman/export/daemon.rb