Skip to content

Commit

Permalink
fix(cli): deployment continues if ECR asset fails to build or publish
Browse files Browse the repository at this point in the history
Fixes #26048, fixes #25827.
  • Loading branch information
rix0rrr committed Jun 20, 2023
1 parent 37e0c43 commit 393f8f0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/aws-cdk/lib/api/deployments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,9 @@ export class Deployments {

const publisher = this.cachedPublisher(assetManifest, stackEnv, options.stackName);
await publisher.buildEntry(asset);
if (publisher.hasFailures) {
throw new Error(`Failed to build asset ${asset.id}`);
}
}

/**
Expand All @@ -601,6 +604,9 @@ export class Deployments {
// No need to validate anymore, we already did that during build
const publisher = this.cachedPublisher(assetManifest, stackEnv, options.stackName);
await publisher.publishEntry(asset);
if (publisher.hasFailures) {
throw new Error(`Failed to publish asset ${asset.id}`);
}
}

/**
Expand Down

0 comments on commit 393f8f0

Please sign in to comment.