Class: Dapp::Build::Stage::ImportArtifact

Inherits:
ArtifactBase show all
Defined in:
lib/dapp/build/stage/import_artifact.rb

Overview

ImportArtifact

Instance Attribute Summary

Attributes inherited from Base

#dimg, #next_stage, #prev_stage

Instance Method Summary collapse

Methods inherited from ArtifactBase

#artifact?, #artifacts, #dependencies

Methods inherited from Base

#artifact?, #build!, #build_lock!, #builder_checksum, #dependencies, #dependencies_empty?, #empty?, #image_add_build_volumes, #image_add_default_volumes, #image_add_tmp_volumes, #image_should_be_build?, #save_in_cache!

Methods included from Mod::Logging

#ignore_log_commands?, #log_build, #log_image_build, #log_image_build_process, #log_image_commands, #log_image_created_at, #log_image_details, #log_image_instructions, #log_image_size, #log_name, #log_name_context, #log_state, #should_be_introspected?, #should_be_quiet?, #should_not_be_detailed?

Methods included from Helper::Trivia

class_to_lowercase, #class_to_lowercase, #delete_file, #kwargs, #search_file_upward

Methods included from Helper::Sha256

#hashsum, #paths_content_hashsum, #sha256

Constructor Details

#initialize(dimg) ⇒ ImportArtifact

Returns a new instance of ImportArtifact.



6
7
8
# File 'lib/dapp/build/stage/import_artifact.rb', line 6

def initialize(dimg)
  @dimg = dimg
end

Instance Method Details

#imageObject



14
15
16
# File 'lib/dapp/build/stage/import_artifact.rb', line 14

def image
  @image ||= Image::Scratch.new(name: image_name, project: dimg.project)
end

#image_add_volumesObject



18
19
# File 'lib/dapp/build/stage/import_artifact.rb', line 18

def image_add_volumes
end

#prepare_imageObject



21
22
23
24
25
26
# File 'lib/dapp/build/stage/import_artifact.rb', line 21

def prepare_image
  super
  change_options.each do |k, v|
    image.public_send("add_change_#{k}", v)
  end
end

#signatureObject



10
11
12
# File 'lib/dapp/build/stage/import_artifact.rb', line 10

def signature
  hashsum [*dependencies.flatten, change_options]
end