Sha256: e19af0edee83860728b968415af7451e7384897669788313f3909a24f5d97800
Contents?: true
Size: 1.03 KB
Versions: 176
Compression:
Stored size: 1.03 KB
Contents
require 'rake/file_utils' require 'yaml' require 'common/deep_copy' require 'bosh/stemcell/aws/region' require 'bosh/stemcell/aws/ami' module Bosh::Stemcell::Aws class LightStemcell def initialize(stemcell) @stemcell = stemcell end def write_archive stemcell.extract(exclude: 'image') do |extracted_stemcell_dir| Dir.chdir(extracted_stemcell_dir) do FileUtils.touch('image', verbose: true) File.open('stemcell.MF', 'w') do |out| Psych.dump(manifest, out) end Rake::FileUtilsExt.sh("sudo tar cvzf #{path} *") end end end def path File.join(File.dirname(stemcell.path), "light-#{File.basename(stemcell.path)}") end private attr_reader :stemcell def manifest region = Region.new ami = Ami.new(stemcell, region) ami_id = ami.publish manifest = Bosh::Common::DeepCopy.copy(stemcell.manifest) manifest['cloud_properties']['ami'] = { region.name => ami_id } manifest end end end
Version data entries
176 entries across 176 versions & 1 rubygems