module Dapp::Dimg::Dimg::Stages
Attributes
last_stage[W]
Public Instance Methods
all_tagged_images()
click to toggle source
# File lib/dapp/dimg/dimg/stages.rb, line 21 def all_tagged_images tagged_images.concat(artifacts.map(&:all_tagged_images).flatten).uniq(&:name) end
last_stage()
click to toggle source
# File lib/dapp/dimg/dimg/stages.rb, line 25 def last_stage @last_stage || begin (self.last_stage = last_stage_class.new(self)).tap do |stage| dapp.log_secondary_process("#{name || 'nameless'}: calculating stages signatures") do stage.signature end unless ignore_signature_auto_calculation end end end
signature()
click to toggle source
# File lib/dapp/dimg/dimg/stages.rb, line 5 def signature last_stage.signature end
stage_by_name(name)
click to toggle source
# File lib/dapp/dimg/dimg/stages.rb, line 9 def stage_by_name(name) stages.find { |s| s.name == name } end
stage_cache_format()
click to toggle source
# File lib/dapp/dimg/dimg/stages.rb, line 13 def stage_cache_format "#{dapp.stage_cache}:%{signature}" end
stage_dapp_label()
click to toggle source
# File lib/dapp/dimg/dimg/stages.rb, line 17 def stage_dapp_label dapp.stage_dapp_label end
Protected Instance Methods
artifacts_stages()
click to toggle source
# File lib/dapp/dimg/dimg/stages.rb, line 56 def artifacts_stages @artifacts_stages ||= stages.select(&:artifact?) end
images()
click to toggle source
# File lib/dapp/dimg/dimg/stages.rb, line 70 def images stages.map(&:image).uniq(&:name) end
import_images()
click to toggle source
# File lib/dapp/dimg/dimg/stages.rb, line 52 def import_images images.select { |image| !image.tagged? } end
last_stage_class()
click to toggle source
# File lib/dapp/dimg/dimg/stages.rb, line 39 def last_stage_class if scratch? Build::Stage::ImportArtifact else Build::Stage::DockerInstructions end end
stages()
click to toggle source
# File lib/dapp/dimg/dimg/stages.rb, line 60 def stages @stages ||= [].tap do |stages| stage = last_stage loop do stages << stage break if (stage = stage.prev_stage).nil? end end end
tagged_images()
click to toggle source
# File lib/dapp/dimg/dimg/stages.rb, line 47 def tagged_images images.select(&:tagged?) end
Also aliased as: export_images