-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(cli): adding new option to cdk deploy
to indicate whether ChangeSet should be executed
#4852
Changes from 1 commit
d275539
e2a7003
d8fc781
acd543e
0d8ab27
3e9ebdc
cfc0486
f31d1cd
bd9caa9
6399716
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,6 +37,7 @@ export interface DeployStackOptions { | |
ci?: boolean; | ||
reuseAssets?: string[]; | ||
tags?: Tag[]; | ||
execute?: boolean; | ||
} | ||
|
||
const LARGE_TEMPLATE_SIZE_KB = 50; | ||
|
@@ -93,13 +94,17 @@ export async function deployStack(options: DeployStackOptions): Promise<DeploySt | |
} | ||
|
||
debug('Initiating execution of changeset %s on stack %s', changeSetName, deployName); | ||
await cfn.executeChangeSet({ StackName: deployName, ChangeSetName: changeSetName }).promise(); | ||
// tslint:disable-next-line:max-line-length | ||
const monitor = options.quiet ? undefined : new StackActivityMonitor(cfn, deployName, options.stack, (changeSetDescription.Changes || []).length).start(); | ||
debug('Execution of changeset %s on stack %s has started; waiting for the update to complete...', changeSetName, deployName); | ||
await waitForStack(cfn, deployName); | ||
if (monitor) { await monitor.stop(); } | ||
debug('Stack %s has completed updating', deployName); | ||
if (options.execute) { | ||
await cfn.executeChangeSet({StackName: deployName, ChangeSetName: changeSetName}).promise(); | ||
// tslint:disable-next-line:max-line-length | ||
const monitor = options.quiet ? undefined : new StackActivityMonitor(cfn, deployName, options.stack, (changeSetDescription.Changes || []).length).start(); | ||
debug('Execution of changeset %s on stack %s has started; waiting for the update to complete...', changeSetName, deployName); | ||
await waitForStack(cfn, deployName); | ||
if (monitor) { | ||
await monitor.stop(); | ||
} | ||
debug('Stack %s has completed updating', deployName); | ||
} | ||
return { noOp: false, outputs: await getStackOutputs(cfn, deployName), stackArn: changeSet.StackId! }; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. clarification: just verifying that this would not count as a noOp as we are still generating a ChangeSet and mutating the state of the stack. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I modified this portion of code but it doesn't show as outdated. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it's a good call not to modify existing tests so we don't mask a potential regression. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I disagree. The fact that tests fail is an indication of a regression, and indeed we've had a regression here where bootstrap stacks failed to execute because "execute" was not passed to it. |
||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not respect the default of "true" (and caused a regression). If
options.execute
is undefined, it evaluates to false.