Skip to content

Commit

Permalink
fix storm
Browse files Browse the repository at this point in the history
  • Loading branch information
jhs88 committed Dec 21, 2024
1 parent b137e67 commit b219a44
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 8 deletions.
14 changes: 11 additions & 3 deletions src/storm/.devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
5 changes: 5 additions & 0 deletions src/storm/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
10 changes: 10 additions & 0 deletions test/storm/test.sh
Original file line number Diff line number Diff line change
@@ -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
9 changes: 4 additions & 5 deletions test/test-utils/test-utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,15 @@

FAILED=()

echoStderr()
{
echoStderr() {
echo "$@" 1>&2
}

check() {
LABEL=$1
shift
echo -e "\n🧪 Testing $LABEL"
if "$@"; then
if "$@"; then
echo "✅ Passed!"
return 0
else
Expand All @@ -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
Expand Down

0 comments on commit b219a44

Please sign in to comment.