-
Notifications
You must be signed in to change notification settings - Fork 694
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* create nodejs_image test cases for launcher and launcher_args add launcher and launcher_args attrs to nodejs_image, and pass them to app_layer update docs with note about launcher and launcher_args for nodejs_image add run-bazel-in-docker.sh allowing non-linux platforms to execute repo build and tests add .idea to .gitignore Add test for using nodejs_image with launcher arg * add documentation for run-bazel-in-docker.sh
- Loading branch information
Showing
8 changed files
with
104 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,3 +53,6 @@ bazel-testlogs | |
|
||
# Npm packages | ||
node_modules | ||
|
||
# JetBrains garbage | ||
.idea/ |
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,15 @@ | ||
# Runs bazel in a docker container, with this repository's workspace mounted in its file system. | ||
# This is useful because rules_docker assumes the host environment is linux, and tests will fail on other environments. | ||
# Running bazel in docker is slower, but allows for the build and tests to execute on non-linux environments. | ||
|
||
mkdir -p /tmp/build_output/ | ||
# -e USER="$(id -u)" \ | ||
# -u="$(id -u)" \ | ||
docker run \ | ||
-v "$PWD":/workspace \ | ||
-v /tmp/build_output:/tmp/build_output \ | ||
-v /var/run/docker.sock:/var/run/docker.sock \ | ||
-w /workspace \ | ||
l.gcr.io/google/bazel:latest \ | ||
--output_user_root=/tmp/build_output \ | ||
"$@" |
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
13 changes: 13 additions & 0 deletions
13
tests/container/nodejs/configs/nodejs_image_with_launcher.yaml
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,13 @@ | ||
schemaVersion: 2.0.0 | ||
|
||
metadataTest: | ||
cmd: ["arg0", "arg1"] | ||
env: | ||
- key: PORT | ||
value: "8080" | ||
- key: DEBIAN_FRONTEND | ||
value: "noninteractive" | ||
- key: PATH | ||
value: "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" | ||
entrypoint: ['/launcher.sh', '/app/tests/container/nodejs/nodejs_image_with_launcher.binary'] | ||
workdir: "/app/tests/container/nodejs/nodejs_image_with_launcher.binary.runfiles/io_bazel_rules_docker" |
13 changes: 13 additions & 0 deletions
13
tests/container/nodejs/configs/nodejs_image_with_launcher_args.yaml
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,13 @@ | ||
schemaVersion: 2.0.0 | ||
|
||
metadataTest: | ||
cmd: ["arg0", "arg1"] | ||
env: | ||
- key: PORT | ||
value: "8080" | ||
- key: DEBIAN_FRONTEND | ||
value: "noninteractive" | ||
- key: PATH | ||
value: "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" | ||
entrypoint: ['/launcher.sh', 'foo', 'bar', '/app/tests/container/nodejs/nodejs_image_with_launcher_args.binary'] | ||
workdir: "/app/tests/container/nodejs/nodejs_image_with_launcher_args.binary.runfiles/io_bazel_rules_docker" |
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,5 @@ | ||
# Do something before running CMD | ||
echo "Do something before running CMD" | ||
|
||
# Run whatever entrypoint / cmd args are passed next | ||
"$@" |