Class: Dapp::Build::Stage::ArtifactBase

Inherits:
Base
  • Object
show all
Defined in:
lib/dapp/build/stage/artifact_base.rb

Overview

ArtifactBase

Direct Known Subclasses

ArtifactDefault, ImportArtifact

Instance Attribute Summary

Attributes inherited from Base

#dimg, #next_stage, #prev_stage

Instance Method Summary collapse

Methods inherited from Base

#build!, #build_lock!, #builder_checksum, #dependencies_empty?, #empty?, #image, #image_add_build_volumes, #image_add_default_volumes, #image_add_tmp_volumes, #image_add_volumes, #image_should_be_build?, #initialize, #save_in_cache!, #signature

Methods included from Mod::Logging

#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?

Methods included from Helper::Trivia

class_to_lowercase, #class_to_lowercase, #delete_file, #kwargs

Methods included from Helper::Sha256

#hashsum, #paths_content_hashsum, #sha256

Constructor Details

This class inherits a constructor from Dapp::Build::Stage::Base

Instance Method Details

#dependencies ⇒ Object



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

def dependencies
  artifacts_signatures
end

#images ⇒ Object



21
22
23
# File 'lib/dapp/build/stage/artifact_base.rb', line 21

def images
  [image].concat(artifacts.map { |artifact| artifact[:dimg].images }.flatten)
end

#prepare_image ⇒ Object



10
11
12
13
14
15
16
17
18
19
# File 'lib/dapp/build/stage/artifact_base.rb', line 10

def prepare_image
  super
  artifacts_dimgs_build!
  artifacts_labels = {}
  artifacts.each do |artifact|
    apply_artifact(artifact, image)
    artifacts_labels["dapp-artifact-#{artifact[:name]}".to_sym] = artifact[:dimg].send(:last_stage).image.built_id
  end
  image.add_service_change_label artifacts_labels
end