-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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): run cdk from inner directories #5772
Merged
Merged
Changes from 8 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
96eecfa
added project dir lookup in cdk.ts
iliapolo aaa3b30
added integration test
iliapolo f1bd763
revert lock file
iliapolo beb547e
phrasing touchup
iliapolo 2472093
Use path.dirname() instead of slicing path parts
iliapolo b18b69f
added sanity test for running cdk outside of project directory
iliapolo cca0fcc
added comment
iliapolo 9a2051f
remove cleanup as the script is being called as a child process
iliapolo 312344a
create temp directory instead of relying on parent directory
iliapolo 6e46efe
added cleanup to remove temp directory
iliapolo 56b40f1
Merge branch 'master' into epolon/cdk-from-inner-directories
mergify[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
12 changes: 12 additions & 0 deletions
12
packages/aws-cdk/test/integ/cli/test-cdk-from-inner-directory.sh
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,12 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
scriptdir=$(cd $(dirname $0) && pwd) | ||
source ${scriptdir}/common.bash | ||
# ---------------------------------------------------------- | ||
|
||
setup | ||
|
||
pushd docker | ||
cdk diff ${STACK_NAME_PREFIX}-test-1 | ||
|
||
echo "✅ success" |
18 changes: 18 additions & 0 deletions
18
packages/aws-cdk/test/integ/cli/test-cdk-from-outer-directory.sh
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,18 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
scriptdir=$(cd $(dirname $0) && pwd) | ||
source ${scriptdir}/common.bash | ||
# ---------------------------------------------------------- | ||
|
||
setup | ||
|
||
pushd .. | ||
set +e | ||
output="$(cdk diff ${STACK_NAME_PREFIX}-test-1 2>&1)" | ||
set -e | ||
|
||
if [[ "${output}" != *"--app is required"* ]]; then | ||
fail "unexpected output when running 'cdk diff' from outer directory: ${output}" | ||
fi | ||
|
||
echo "✅ success" |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
move to a temp directory instead. you don't know what's going on in ".."