Class: Bosh::Stemcell::OsImageBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/bosh/stemcell/os_image_builder.rb

Instance Method Summary collapse

Constructor Details

#initialize(dependencies = {}) ⇒ OsImageBuilder

Returns a new instance of OsImageBuilder.


3
4
5
6
7
8
# File 'lib/bosh/stemcell/os_image_builder.rb', line 3

def initialize(dependencies = {})
  @environment = dependencies.fetch(:environment)
  @collection = dependencies.fetch(:collection)
  @runner = dependencies.fetch(:runner)
  @archive_handler = dependencies.fetch(:archive_handler)
end

Instance Method Details

#build(os_image_path) ⇒ Object


10
11
12
13
14
# File 'lib/bosh/stemcell/os_image_builder.rb', line 10

def build(os_image_path)
  environment.prepare_build
  runner.configure_and_apply(collection.operating_system_stages, ENV['resume_from'])
  archive_handler.compress(environment.chroot_dir, os_image_path)
end