Class: Bosh::Director::DeploymentPlan::DeploymentSpecParser

Inherits:
Object
  • Object
show all
Includes:
ValidationHelper
Defined in:
lib/bosh/director/deployment_plan/deployment_spec_parser.rb

Instance Method Summary collapse

Methods included from ValidationHelper

#safe_property

Constructor Details

#initialize(deployment, event_log, logger) ⇒ DeploymentSpecParser

Returns a new instance of DeploymentSpecParser.



6
7
8
9
10
# File 'lib/bosh/director/deployment_plan/deployment_spec_parser.rb', line 6

def initialize(deployment, event_log, logger)
  @event_log = event_log
  @logger = logger
  @deployment = deployment
end

Instance Method Details

#parse(deployment_manifest, options = {}) ⇒ DeploymentPlan::Planner

Returns Deployment as build from deployment_spec.

Parameters:

  • manifest (Hash)

    Raw deployment manifest

Returns:



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/bosh/director/deployment_plan/deployment_spec_parser.rb', line 14

def parse(deployment_manifest, options = {})
  @deployment_manifest = deployment_manifest
  @job_states = safe_property(options, 'job_states', :class => Hash, :default => {})

  parse_options = {}
  if options['canaries']
    parse_options['canaries'] = options['canaries']
    @logger.debug("Using canaries value #{options['canaries']} given in a command line.")
  end

  if options['max_in_flight']
    parse_options['max_in_flight'] = options['max_in_flight']
    @logger.debug("Using max_in_flight value #{options['max_in_flight']} given in a command line.")
  end

  parse_stemcells
  parse_properties
  parse_releases
  parse_update(parse_options)
  parse_jobs(parse_options)

  @deployment
end