class OpsDeploy::DeploymentWaiter

A waiter for deployments

Public Class Methods

new(opsworks, deployment, callback = nil) click to toggle source
Calls superclass method OpsDeploy::Waiter::new
# File lib/ops_deploy/waiter.rb, line 30
def initialize(opsworks, deployment, callback = nil)
  super() do
    find_deployment(opsworks, deployment.deployment_id)
  end

  @end_when = proc do |deployment_obj|
    deployment_obj.status != 'running'
  end

  @callback = callback
end

Private Instance Methods

find_deployment(opsworks, deployment_id) click to toggle source
# File lib/ops_deploy/waiter.rb, line 44
def find_deployment(opsworks, deployment_id)
  deploy = opsworks.describe_deployments(deployment_ids: [deployment_id])
           .deployments.first

  # Retry if there's no duration
  if deploy.status != 'running' && deploy.duration.nil?
    deploy = opsworks.describe_deployments(deployment_ids: [deployment_id])
             .deployments.first
  end

  deploy
end