Class: R10K::Deployment

Inherits:
Object
  • Object
show all
Defined in:
lib/r10k/deployment.rb,
lib/r10k/deployment/config.rb,
lib/r10k/deployment/source.rb,
lib/r10k/deployment/basedir.rb,
lib/r10k/deployment/config/loader.rb

Defined Under Namespace

Classes: Basedir, Config, Environment, Source

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ Deployment

Returns a new instance of Deployment.



23
24
25
# File 'lib/r10k/deployment.rb', line 23

def initialize(config)
  @config = config
end

Class Method Details

.load_config(path) ⇒ R10K::Deployment

Generate a deployment object based on a config

Parameters:

  • path (String)

    The path to the deployment config

Returns:



18
19
20
21
# File 'lib/r10k/deployment.rb', line 18

def self.load_config(path)
  config = R10K::Deployment::Config.new(path)
  new(config)
end

Instance Method Details

#environmentsArray<R10K::Environment::Base>

Lazily load all environments

This instantiates the @_environments instance variable, but should not be used directly as it could be legitimately unset if we’re doing lazy loading.

Returns:



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

def environments
  load_environments if @_environments.nil?
  @_environments
end

#preload!Object Also known as: fetch_sources



27
28
29
# File 'lib/r10k/deployment.rb', line 27

def preload!
  sources.each(&:preload!)
end

#sourcesArray<R10K::Source::Base>

Lazily load all sources

This instantiates the @_sources instance variable, but should not be used directly as it could be legitimately unset if we’re doing lazy loading.

Returns:



40
41
42
43
# File 'lib/r10k/deployment.rb', line 40

def sources
  load_sources if @_sources.nil?
  @_sources
end