Class: Dapp::Dimg::Build::Stage::GALatestPatch

Inherits:
GABase
  • Object
show all
Defined in:
lib/dapp/dimg/build/stage/ga_latest_patch.rb

Direct Known Subclasses

GAArtifactPatch

Instance Attribute Summary

Attributes inherited from Base

#dimg, #next_stage, #prev_stage

Instance Method Summary collapse

Methods inherited from GABase

#prepare_base_git_artifacts_command, #prepare_image, #prepare_remote_git_artifacts_command

Methods inherited from Base

#adding_mounts_by_type, #artifact?, #build!, #build_lock!, #builder_checksum, #config_mounts_by_type, #dependencies_empty?, #git_artifacts_dependencies, #image, #image_add_mounts, #image_should_be_build?, #labels_mounts_by_type, #name, #prepare_image, #save_in_cache!, #signature

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, next_stage) ⇒ GALatestPatch

Returns a new instance of GALatestPatch.



6
7
8
9
# File 'lib/dapp/dimg/build/stage/ga_latest_patch.rb', line 6

def initialize(dimg, next_stage)
  @prev_stage = AfterSetupArtifact.new(dimg, self)
  super
end

Instance Method Details

#dependenciesObject



23
24
25
26
27
28
# File 'lib/dapp/dimg/build/stage/ga_latest_patch.rb', line 23

def dependencies
  [].tap do |dependencies|
    dependencies << commit_list
    dependencies << dimg.local_git_artifacts.map { |git_artifact| git_artifact.dev_patch_hash(self) } if dimg.dapp.dev_mode?
  end
end

#dependencies_stageObject



19
20
21
# File 'lib/dapp/dimg/build/stage/ga_latest_patch.rb', line 19

def dependencies_stage
  nil
end

#empty?Boolean

Returns:

  • (Boolean)


41
42
43
# File 'lib/dapp/dimg/build/stage/ga_latest_patch.rb', line 41

def empty?
  dependencies_empty? || dimg.git_artifacts.all? { |git_artifact| !git_artifact.any_changes?(prev_g_a_stage.layer_commit(git_artifact)) }
end

#layer_commit(git_artifact) ⇒ Object



35
36
37
38
39
# File 'lib/dapp/dimg/build/stage/ga_latest_patch.rb', line 35

def layer_commit(git_artifact)
  commits[git_artifact] ||= begin
    git_artifact.latest_commit
  end
end

#next_g_a_stageObject



15
16
17
# File 'lib/dapp/dimg/build/stage/ga_latest_patch.rb', line 15

def next_g_a_stage
  nil
end

#prepare_local_git_artifacts_commandObject



30
31
32
33
# File 'lib/dapp/dimg/build/stage/ga_latest_patch.rb', line 30

def prepare_local_git_artifacts_command
  return super unless dimg.dapp.dev_mode?
  dimg.local_git_artifacts.each { |git_artifact| image.add_command git_artifact.apply_dev_patch_command(self) }
end

#prev_g_a_stageObject



11
12
13
# File 'lib/dapp/dimg/build/stage/ga_latest_patch.rb', line 11

def prev_g_a_stage
  prev_stage.prev_stage
end