Sha256: cf39ab9b96c43d587ac41a48607a8a008931a4a70ecce061d06c20de8d65e819

Contents?: true

Size: 995 Bytes

Versions: 85

Compression:

Stored size: 995 Bytes

Contents

class Dockly::Foreman
  include Dockly::Util::DSL
  include Dockly::Util::Logger::Mixin

  logger_prefix '[dockly foreman]'
  dsl_attribute :name, :env, :procfile, :type, :user, :root_dir, :init_dir,
                :log_dir, :build_dir, :prefix

  default_value :build_dir, 'build/foreman'
  default_value :env, ""
  default_value :procfile, './Procfile'
  default_value :type, 'upstart'
  default_value :user, 'nobody'
  default_value :root_dir, "/tmp"
  default_value :init_dir, "/etc/init"
  default_value :log_dir, '/var/log'

  def create!
    ensure_present! :name, :init_dir, :build_dir, :procfile, :type, :user

    info "cleaning build dir"
    FileUtils.rm_rf(build_dir)
    FileUtils.mkdir_p(build_dir)
    cli = ::Foreman::CLI.new
    cli.options = {
      :root => root_dir,
      :env => env,
      :procfile => procfile,
      :app => name,
      :log => log_dir,
      :prefix => prefix,
      :user => user,
    }
    info "exporting"
    cli.export(type, build_dir)
  end
end

Version data entries

85 entries across 85 versions & 1 rubygems

Version Path
dockly-4.4.1 lib/dockly/foreman.rb
dockly-4.4.0 lib/dockly/foreman.rb
dockly-4.3.0 lib/dockly/foreman.rb
dockly-4.2.0 lib/dockly/foreman.rb
dockly-4.1.0 lib/dockly/foreman.rb
dockly-4.0.0 lib/dockly/foreman.rb
dockly-3.4.1 lib/dockly/foreman.rb
dockly-3.4.0 lib/dockly/foreman.rb
dockly-3.3.0 lib/dockly/foreman.rb
dockly-3.2.0.pre.1 lib/dockly/foreman.rb
dockly-3.1.1 lib/dockly/foreman.rb
dockly-3.1.0 lib/dockly/foreman.rb
dockly-3.0.5 lib/dockly/foreman.rb
dockly-3.0.4 lib/dockly/foreman.rb
dockly-3.0.3 lib/dockly/foreman.rb
dockly-3.0.2 lib/dockly/foreman.rb
dockly-3.0.1 lib/dockly/foreman.rb
dockly-3.0.0 lib/dockly/foreman.rb
dockly-2.7.2 lib/dockly/foreman.rb
dockly-2.7.1 lib/dockly/foreman.rb