Skip to content

Commit

Permalink
fix(aws): Allow deploys to continue if lifecycles fail to create (#1500)
Browse files Browse the repository at this point in the history
  • Loading branch information
robzienert committed Mar 13, 2017
1 parent f898bb8 commit aad7688
Showing 1 changed file with 8 additions and 1 deletion.
Expand Up @@ -16,6 +16,7 @@

package com.netflix.spinnaker.clouddriver.aws.deploy.handlers

import com.amazonaws.AmazonServiceException
import com.amazonaws.services.autoscaling.model.BlockDeviceMapping
import com.amazonaws.services.autoscaling.model.DescribeAutoScalingGroupsRequest
import com.amazonaws.services.autoscaling.model.LaunchConfiguration
Expand Down Expand Up @@ -45,9 +46,11 @@ import com.netflix.spinnaker.clouddriver.deploy.DeploymentResult
import com.netflix.spinnaker.clouddriver.orchestration.events.CreateServerGroupEvent
import com.netflix.spinnaker.clouddriver.security.AccountCredentialsRepository
import groovy.transform.PackageScope
import groovy.util.logging.Slf4j

import java.util.regex.Pattern

@Slf4j
class BasicAmazonDeployHandler implements DeployHandler<BasicAmazonDeployDescription> {
private static final String BASE_PHASE = "DEPLOY"

Expand Down Expand Up @@ -385,7 +388,11 @@ class BasicAmazonDeployHandler implements DeployHandler<BasicAmazonDeployDescrip

List<AmazonAsgLifecycleHook> lifecycleHooks = getLifecycleHooks(targetCredentials, description)
if (lifecycleHooks.size() > 0) {
targetRegionScopedProvider.asgLifecycleHookWorker.attach(task, lifecycleHooks, targetAsgName)
try {
targetRegionScopedProvider.asgLifecycleHookWorker.attach(task, lifecycleHooks, targetAsgName)
} catch (AmazonServiceException ase) {
task.updateStatus(BASE_PHASE, "Unable to attach lifecycle hooks to ASG ($targetAsgName): ${ase.message}")
}
}
}

Expand Down

0 comments on commit aad7688

Please sign in to comment.