Class: Bosh::Director::DeploymentPlan::SerialMultiJobUpdater

Inherits:
Object
  • Object
show all
Defined in:
lib/bosh/director/deployment_plan/multi_job_updater.rb

Instance Method Summary collapse

Constructor Details

#initialize(job_updater_factory) ⇒ SerialMultiJobUpdater

Returns a new instance of SerialMultiJobUpdater.



4
5
6
# File 'lib/bosh/director/deployment_plan/multi_job_updater.rb', line 4

def initialize(job_updater_factory)
  @job_updater_factory = job_updater_factory
end

Instance Method Details

#run(base_job, deployment_plan, jobs) ⇒ Object



8
9
10
11
12
13
14
15
16
17
# File 'lib/bosh/director/deployment_plan/multi_job_updater.rb', line 8

def run(base_job, deployment_plan, jobs)
  base_job.logger.info("Updating jobs serially: #{jobs.map(&:name).join(', ')}")

  jobs.each do |j|
    base_job.task_checkpoint
    base_job.logger.info("Updating job: #{j.name}")
    job_updater = @job_updater_factory.new_job_updater(deployment_plan, j)
    job_updater.update
  end
end