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

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

Overview

GABase

Instance Attribute Summary collapse

Attributes inherited from Base

#application, #next_stage, #prev_stage

Instance Method Summary collapse

Methods inherited from Base

#build!, #build_lock!, #dependencies, #dependencies_empty?, #image, #image_add_tmp_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 Attribute Details

#next_g_a_stageObject

Returns the value of attribute next_g_a_stage.



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

def next_g_a_stage
  @next_g_a_stage
end

#prev_g_a_stageObject

Returns the value of attribute prev_g_a_stage.



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

def prev_g_a_stage
  @prev_g_a_stage
end

Instance Method Details

#dependencies_stageObject



16
17
18
# File 'lib/dapp/build/stage/ga_base.rb', line 16

def dependencies_stage
  prev_stage
end

#empty?Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/dapp/build/stage/ga_base.rb', line 30

def empty?
  dependencies_stage.empty?
end

#layer_commit(git_artifact) ⇒ Object



34
35
36
37
38
39
40
41
42
# File 'lib/dapp/build/stage/ga_base.rb', line 34

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



20
21
22
23
24
25
26
27
28
# File 'lib/dapp/build/stage/ga_base.rb', line 20

def prepare_image
  super
  image.add_volumes_from application.project.gitartifact_container

  application.git_artifacts.each do |git_artifact|
    image.add_volume "#{git_artifact.repo.path}:#{git_artifact.repo.container_path}:ro"
    image.add_command git_artifact.send(apply_command_method, self)
  end
end