Class: R10K::Task::Deployment::PurgeEnvironments Deprecated

Inherits:
Base
  • Object
show all
Defined in:
lib/r10k/task/deployment.rb

Overview

Deprecated.

Constant Summary

Constants included from Logging

Logging::LOG_LEVELS

Instance Attribute Summary

Attributes inherited from Base

#task_runner

Instance Method Summary collapse

Methods included from Logging

formatter, included, level, level=, levels, #logger, #logger_name, outputter, parse_level

Constructor Details

#initialize(deployment) ⇒ PurgeEnvironments

Returns a new instance of PurgeEnvironments.



122
123
124
125
# File 'lib/r10k/task/deployment.rb', line 122

def initialize(deployment)
  @deployment = deployment
  @basedirs   = @deployment.sources.map { |x| x.basedir }.uniq
end

Instance Method Details

#callObject



127
128
129
130
131
132
133
# File 'lib/r10k/task/deployment.rb', line 127

def call
  @basedirs.each do |path|
    basedir = R10K::Util::Basedir.from_deployment(path, @deployment)
    logger.info "Purging stale environments from #{path}"
    basedir.purge!
  end
end