-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(core,s3-assets): custom bundling docker command
In order to support environments in which docker cannot be executed or has a unique location, we added an environment variable `CDK_DOCKER` which is used instead of `docker` if defined. Resolves #8460
- Loading branch information
Elad Ben-Israel
committed
Jun 10, 2020
1 parent
1e78a68
commit 81a6606
Showing
5 changed files
with
100 additions
and
18 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
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,27 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
|
||
# stub for the `docker` executable. it is used as CDK_DOCKER when executing unit | ||
# tests in `test.staging.ts` It outputs the command line to | ||
# `/tmp/docker-stub.input` and accepts one of 3 commands that impact it's | ||
# behavior. | ||
|
||
echo "$@" > /tmp/docker-stub.input | ||
|
||
if echo "$@" | grep "DOCKER_STUB_SUCCESS_NO_OUTPUT"; then | ||
exit 0 | ||
fi | ||
|
||
if echo "$@" | grep "DOCKER_STUB_FAIL"; then | ||
echo "A HUGE FAILING DOCKER STUFF" | ||
exit 1 | ||
fi | ||
|
||
if echo "$@" | grep "DOCKER_STUB_SUCCESS"; then | ||
outdir=$(echo "$@" | xargs -n1 | grep "/asset-output" | head -n1 | cut -d":" -f1) | ||
touch ${outdir}/test.txt | ||
exit 0 | ||
fi | ||
|
||
echo "Docker mock only supports one of the following commands: DOCKER_STUB_SUCCESS_NO_OUTPUT,DOCKER_STUB_FAIL,DOCKER_STUB_SUCCESS" | ||
exit 1 |
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