Class: R10K::Task::Deployment::DeployEnvironments

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

Constant Summary

Constants included from Logging

Logging::LOG_LEVELS

Instance Attribute Summary collapse

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) ⇒ DeployEnvironments

Returns a new instance of DeployEnvironments.



56
57
58
59
60
# File 'lib/r10k/task/deployment.rb', line 56

def initialize(deployment)
  @deployment = deployment
  @update_puppetfile = false
  @environment_names = []
end

Instance Attribute Details

#environment_namesArray<String>

Returns A list of environments to deploy, by name.

Returns:

  • (Array<String>)

    A list of environments to deploy, by name.



50
51
52
# File 'lib/r10k/task/deployment.rb', line 50

def environment_names
  @environment_names
end

#update_puppetfileTrueClass, FalseClass

Returns Whether to deploy modules in a puppetfile.

Returns:

  • (TrueClass, FalseClass)

    Whether to deploy modules in a puppetfile



54
55
56
# File 'lib/r10k/task/deployment.rb', line 54

def update_puppetfile
  @update_puppetfile
end

Instance Method Details

#callObject



62
63
64
65
66
67
68
69
70
71
# File 'lib/r10k/task/deployment.rb', line 62

def call
  logger.info "Loading environments from all sources"
  @deployment.fetch_sources

  with_environments(@environment_names) do |env|
    task = R10K::Task::Environment::Deploy.new(env)
    task.update_puppetfile = @update_puppetfile
    task_runner.insert_task_after(self, task)
  end
end