Sha256: 34275872785071638b05b9bd162ba32073a7e047be078b13df82148d4f859021

Contents?: true

Size: 806 Bytes

Versions: 24

Compression:

Stored size: 806 Bytes

Contents

require "erb"
require "foreman/export"

class Foreman::Export::Bluepill < Foreman::Export::Base

  def export(location, options={})
    error("Must specify a location") unless location

    FileUtils.mkdir_p location

    app = options[:app] || File.basename(engine.directory)
    user = options[:user] || app
    log_root = options[:log] || "/var/log/#{app}"
    template_root = options[:template]

    Dir["#{location}/#{app}.pill"].each do |file|
      say "cleaning up: #{file}"
      FileUtils.rm(file)
    end

    concurrency = Foreman::Utils.parse_concurrency(options[:concurrency])

    master_template = export_template("bluepill", "master.pill.erb", template_root)
    master_config   = ERB.new(master_template).result(binding)
    write_file "#{location}/#{app}.pill", master_config
  end

end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
foreman-0.37.0.pre3-mingw32 lib/foreman/export/bluepill.rb
foreman-0.37.0.pre3-java lib/foreman/export/bluepill.rb
foreman-0.37.0.pre3 lib/foreman/export/bluepill.rb
foreman-0.37.0.pre2-java lib/foreman/export/bluepill.rb
foreman-0.37.0.pre2 lib/foreman/export/bluepill.rb
foreman-0.37.0.pre1-java lib/foreman/export/bluepill.rb
foreman-0.37.0.pre1 lib/foreman/export/bluepill.rb
foreman-0.36.1 lib/foreman/export/bluepill.rb
foreman-0.36.0 lib/foreman/export/bluepill.rb
foreman-0.35.0 lib/foreman/export/bluepill.rb
foreman-0.34.1 lib/foreman/export/bluepill.rb
foreman-0.34.0 lib/foreman/export/bluepill.rb
foreman-0.33.1 lib/foreman/export/bluepill.rb
foreman-0.33.0 lib/foreman/export/bluepill.rb
foreman-0.32.0 lib/foreman/export/bluepill.rb
foreman-0.31.0 lib/foreman/export/bluepill.rb
foreman-0.30.1 lib/foreman/export/bluepill.rb
foreman-0.30.0 lib/foreman/export/bluepill.rb
foreman-0.29.0 lib/foreman/export/bluepill.rb
foreman-0.28.0.pre2 lib/foreman/export/bluepill.rb