Class: Navy::AppContainerBuilder

Inherits:
Object
  • Object
show all
Includes:
ContainerBuilding
Defined in:
lib/navy/app_container_builder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(app, config, options) ⇒ AppContainerBuilder

Returns a new instance of AppContainerBuilder.



6
7
8
9
10
# File 'lib/navy/app_container_builder.rb', line 6

def initialize(app, config, options)
  @options = options.dup
  @options[:app] = app
  @options[:config] = config
end

Instance Attribute Details

#dependenciesObject (readonly)

Returns the value of attribute dependencies.



4
5
6
# File 'lib/navy/app_container_builder.rb', line 4

def dependencies
  @dependencies
end

#optionsObject (readonly)

Returns the value of attribute options.



4
5
6
# File 'lib/navy/app_container_builder.rb', line 4

def options
  @options
end

#specificationObject (readonly)

Returns the value of attribute specification.



4
5
6
# File 'lib/navy/app_container_builder.rb', line 4

def specification
  @specification
end

Instance Method Details

#buildObject



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/navy/app_container_builder.rb', line 12

def build
  @specification = {
    :type => "application",
    :env => {},
    :links => [],
    :volumes_from => []
  }
  @dependencies = []
  app = options.delete :app
  config = options.delete :config
  @options = options
  build_specification(app, config)
  build_dependencies(app, config)
  build_container
end