-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(toolkit): scrutiny dialog should fail with no tty (#1382)
If STDIN is not connected to a TTY (terminal), and scrutiny is enabled, we expect the program to fail (exit with non-zero exit code). This is especially important for CI/CD scenarios where you wouldn't want to accidentally deploy changes that didn't pass a scrutiny check. Added integration test. Fixes #1380
- Loading branch information
Elad Ben-Israel
authored
Dec 19, 2018
1 parent
8c733ef
commit 478a714
Showing
3 changed files
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
scriptdir=$(cd $(dirname $0) && pwd) | ||
source ${scriptdir}/common.bash | ||
# ---------------------------------------------------------- | ||
|
||
setup | ||
|
||
# redirect /dev/null to stdin, which means there will not be tty attached | ||
# since this stack includes security-related changes, the deployment should | ||
# immediately fail because we can't confirm the changes | ||
if cdk deploy cdk-toolkit-integration-iam-test < /dev/null; then | ||
fail "test failed. we expect 'cdk deploy' to fail if there are security-related changes and no tty" | ||
fi | ||
|
||
echo "✅ success" |