Sha256: 0a351c5dec56c54b84aea704808ca259fdadb06f3c65e25847a8646c7db36073
Contents?: true
Size: 1.02 KB
Versions: 1
Compression:
Stored size: 1.02 KB
Contents
module Percheron module Actions class Recreate include Base def initialize(unit, start: false) @unit = unit @start = start end def execute! results = [] if recreate? results << recreate! results << start! else inform! end results.compact.empty? ? nil : unit end private attr_reader :unit, :start alias_method :start?, :start def recreate? !unit.versions_match? || !unit.dockerfile_md5s_match? end def inform! return nil unless unit.dockerfile_md5s_match? $logger.info "Unit '#{unit.display_name}' - No Dockerfile changes or version bump" end def recreate! $logger.debug "Unit '#{unit.display_name}' exists but will be recreated" Purge.new(unit).execute! Create.new(unit).execute! end def start! Start.new(unit).execute! if start? end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
percheron-0.7.14 | lib/percheron/actions/recreate.rb |