Class: Bosh::Stemcell::BuilderOptions

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/bosh/stemcell/builder_options.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(dependencies = {}) ⇒ BuilderOptions

Returns a new instance of BuilderOptions.


9
10
11
12
13
14
15
16
17
# File 'lib/bosh/stemcell/builder_options.rb', line 9

def initialize(dependencies = {})
  @environment = dependencies.fetch(:env)
  @definition = dependencies.fetch(:definition)

  @stemcell_version = dependencies.fetch(:version)
  @image_create_disk_size = dependencies.fetch(:disk_size, infrastructure.default_disk_size)
  @bosh_micro_release_tgz_path = dependencies.fetch(:release_tarball)
  @os_image_tgz_path = dependencies.fetch(:os_image_tarball)
end

Instance Attribute Details

#stemcell_versionObject (readonly)

Returns the value of attribute stemcell_version


36
37
38
# File 'lib/bosh/stemcell/builder_options.rb', line 36

def stemcell_version
  @stemcell_version
end

Instance Method Details

#defaultObject


19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/bosh/stemcell/builder_options.rb', line 19

def default
  {
    'stemcell_image_name' => stemcell_image_name,
    'stemcell_version' => stemcell_version,
    'stemcell_hypervisor' => infrastructure.hypervisor,
    'stemcell_infrastructure' => infrastructure.name,
    'stemcell_operating_system' => operating_system.name,
    'stemcell_operating_system_version' => operating_system.version,
    'ruby_bin' => ruby_bin,
    'bosh_release_src_dir' => File.join(source_root, 'release/src/bosh'),
    'agent_src_dir' => File.join(source_root, 'go/src/github.com/cloudfoundry/bosh-agent'),
    'davcli_src_dir' => File.join(source_root, 'go/src/github.com/cloudfoundry/bosh-davcli'),
    'image_create_disk_size' => image_create_disk_size,
    'os_image_tgz' => os_image_tgz_path,
  }.merge(bosh_micro_options).merge(environment_variables).merge(ovf_options)
end