Class: Bosh::Stemcell::StemcellPackager

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

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ StemcellPackager

Returns a new instance of StemcellPackager.



4
5
6
7
8
9
10
11
12
# File 'lib/bosh/stemcell/stemcell_packager.rb', line 4

def initialize(options = {})
  @definition = options.fetch(:definition)
  @version = options.fetch(:version)
  @stemcell_build_path = File.join(options.fetch(:work_path), 'stemcell')
  @tarball_path = options.fetch(:tarball_path)
  @disk_size = options.fetch(:disk_size)
  @runner = options.fetch(:runner)
  @collection = options.fetch(:collection)
end

Instance Method Details

#package(disk_format) ⇒ Object



14
15
16
17
18
19
20
21
# File 'lib/bosh/stemcell/stemcell_packager.rb', line 14

def package(disk_format)
  File.delete(stemcell_image_path) if File.exist?(stemcell_image_path)

  runner.configure_and_apply(collection.package_stemcell_stages(disk_format))

  write_manifest(disk_format)
  create_tarball(disk_format)
end