Class: Dapp::Dimg::Build::Stage::GABase

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

Instance Attribute Summary

Attributes inherited from Base

#dimg, #next_stage, #prev_stage

Instance Method Summary collapse

Methods inherited from Base

#adding_custom_dir_mounts, #adding_mounts_by_type, #artifact?, #build!, #build_lock!, #builder_checksum, #config_custom_dir_mounts, #config_mounts_by_type, #dependencies, #dependencies_empty?, #git_artifacts_dependencies, #image, #image_add_custom_mounts, #image_add_mounts, #image_introspect, #initialize, #labels_custom_dir_mounts, #labels_mounts_by_type, #name, #next_g_a_stage, #prev_g_a_stage, #save_in_cache!, #signature

Methods included from Mod::Logging

#image_should_be_introspected?, #log_build, #log_image_build, #log_image_commands, #log_image_created_at, #log_image_details, #log_image_instructions, #log_image_size, #log_name, #log_name_context, #log_state

Methods included from Helper::Trivia

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

Methods included from Helper::Sha256

#hashsum, #paths_content_hashsum, #sha256

Constructor Details

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

Instance Method Details

#dependencies_stageObject



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

def dependencies_stage
  prev_stage
end

#empty?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/dapp/dimg/build/stage/ga_base.rb', line 20

def empty?
  dependencies_stage.empty?
end

#g_a_stage?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/dapp/dimg/build/stage/ga_base.rb', line 24

def g_a_stage?
  true
end

#layer_commit(git_artifact) ⇒ Object



28
29
30
31
32
33
34
35
36
# File 'lib/dapp/dimg/build/stage/ga_base.rb', line 28

def layer_commit(git_artifact)
  commits[git_artifact] ||= begin
    if dependencies_stage && dependencies_stage.image.tagged?
      dependencies_stage.image.labels[git_artifact.full_name]
    else
      git_artifact.latest_commit
    end
  end
end

#prepare_imageObject



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

def prepare_image
  super do
    image.add_volumes_from dimg.dapp.gitartifact_container
    image.add_volume "#{dimg.tmp_path('archives')}:#{dimg.container_tmp_path('archives')}:ro"
    image.add_volume "#{dimg.tmp_path('patches')}:#{dimg.container_tmp_path('patches')}:ro"

    dimg.git_artifacts.each { |git_artifact| image.add_command git_artifact.send(apply_command_method, self) }
  end
end