Sha256: e723fccc3f30b04b0061484dd2b2716f31aa3bcb438eb9bb0eb37e53e16dc7d8
Contents?: true
Size: 1.11 KB
Versions: 2
Compression:
Stored size: 1.11 KB
Contents
module Percheron module Actions class Recreate include Base def initialize(unit, start: false, force: false) @unit = unit @start = start @force = force end def execute! results = [] if recreate? || force? results << recreate! results << start! else inform! end results.compact.empty? ? nil : unit end private attr_reader :unit, :start, :force alias_method :start?, :start alias_method :force?, :force 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
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
percheron-0.7.16 | lib/percheron/actions/recreate.rb |
percheron-0.7.15 | lib/percheron/actions/recreate.rb |