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.



63
64
65
66
67
# File 'lib/r10k/task/deployment.rb', line 63

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.



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

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



61
62
63
# File 'lib/r10k/task/deployment.rb', line 61

def update_puppetfile
  @update_puppetfile
end

Instance Method Details

#callObject



69
70
71
72
73
74
75
76
77
78
# File 'lib/r10k/task/deployment.rb', line 69

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