diff --git a/src/storm/.devcontainer/Dockerfile b/src/storm/.devcontainer/Dockerfile index 06935fb..de8af07 100644 --- a/src/storm/.devcontainer/Dockerfile +++ b/src/storm/.devcontainer/Dockerfile @@ -1,6 +1,14 @@ FROM storm:${templateOption:stormVersion} AS storm -ARG DISTRO_NAME=apache-storm-${templateOption:stormVersion} FROM mcr.microsoft.com/devcontainers/java:1-${templateOption:javaVersion}-${templateOption:imageVariant} -COPY --from=storm /$DISTRO_NAME /$DISTRO_NAME -ENV PATH $PATH:/$DISTRO_NAME/bin +ARG DISTRO_NAME=apache-storm-${templateOption:stormVersion} +ENV PATH $PATH:/$DISTRO_NAME/bin \ + JAVA_HOME=/docker-java-home \ + STORM_CONF_DIR=/conf \ + STORM_DATA_DIR=/data \ + STORM_LOG_DIR=/logs + +RUN mkdir -p "$STORM_CONF_DIR" "$STORM_DATA_DIR" "$STORM_LOG_DIR"; \ + chown -R vscode:vscode "$STORM_CONF_DIR" "$STORM_DATA_DIR" "$STORM_LOG_DIR"; + +COPY --from=storm --chown=vscode:vscode /$DISTRO_NAME /$DISTRO_NAME diff --git a/src/storm/.devcontainer/devcontainer.json b/src/storm/.devcontainer/devcontainer.json index c69a303..c3603e5 100644 --- a/src/storm/.devcontainer/devcontainer.json +++ b/src/storm/.devcontainer/devcontainer.json @@ -11,6 +11,11 @@ "installMaven": "true", "installGradle": "false" } + }, + + // ๐Ÿ‘‡ Use 'settings' to set *default* container specific settings.json values on container create. + "containerEnv": { + "JAVA_HOME": "/usr/lib/jvm/msopenjdk-current" } // ๐Ÿ‘‡ Use 'forwardPorts' to make a list of ports inside the container available locally. diff --git a/test/storm/test.sh b/test/storm/test.sh new file mode 100644 index 0000000..f3cd108 --- /dev/null +++ b/test/storm/test.sh @@ -0,0 +1,10 @@ +#!/bin/bash +cd $(dirname "$0") +source test-utils.sh + +# Template specific tests +check "distro" lsb_release -c +check "storm" storm --version + +# Report result +reportResults diff --git a/test/test-utils/test-utils.sh b/test/test-utils/test-utils.sh index 5e4b4ae..0984a94 100644 --- a/test/test-utils/test-utils.sh +++ b/test/test-utils/test-utils.sh @@ -2,8 +2,7 @@ FAILED=() -echoStderr() -{ +echoStderr() { echo "$@" 1>&2 } @@ -11,7 +10,7 @@ check() { LABEL=$1 shift echo -e "\n๐Ÿงช Testing $LABEL" - if "$@"; then + if "$@"; then echo "โœ… Passed!" return 0 else @@ -23,9 +22,9 @@ check() { reportResults() { if [ ${#FAILED[@]} -ne 0 ]; then - echoStderr -e "\n๐Ÿ’ฅ Failed tests: ${FAILED[@]}" + echoStderr -e "\n๐Ÿ’ฅ Failed tests:" "${FAILED[@]}" exit 1 - else + else echo -e "\n๐Ÿ’ฏ All passed!" exit 0 fi