Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
comcalvi committed Apr 17, 2024
1 parent 41d2c52 commit 19a4dbd
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/aws-cdk/lib/api/deploy-stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,11 +262,13 @@ export async function deployStack(options: DeployStackOptions): Promise<DeploySt
? templateParams.updateExisting(finalParameterValues, cloudFormationStack.parameters)
: templateParams.supplyAll(finalParameterValues);

const hotswapMode = options.hotswap ?? HotswapMode.FULL_DEPLOYMENT;

if (await canSkipDeploy(options, cloudFormationStack, stackParams.hasChanges(cloudFormationStack.parameters))) {
debug(`${deployName}: skipping deployment (use --force to override)`);
// if we can skip deployment and we are performing a hotswap, let the user know
// that no hotswap deployment happened
if (options.hotswap !== HotswapMode.FULL_DEPLOYMENT) {
if (hotswapMode !== HotswapMode.FULL_DEPLOYMENT) {
print(`\n ${ICON} %s\n`, chalk.bold('hotswap deployment skipped - no changes were detected (use --force to override)'));
}
return {
Expand All @@ -289,8 +291,7 @@ export async function deployStack(options: DeployStackOptions): Promise<DeploySt
parallel: options.assetParallelism,
});

const hotswapMode = options.hotswap;
if (hotswapMode && hotswapMode !== HotswapMode.FULL_DEPLOYMENT) {
if (hotswapMode !== HotswapMode.FULL_DEPLOYMENT) {
// attempt to short-circuit the deployment if possible
try {
const hotswapDeploymentResult = await tryHotswapDeployment(
Expand Down

0 comments on commit 19a4dbd

Please sign in to comment.