Skip to content

Commit

Permalink
Merge pull request #43 from artamonovkirill/bump/java-21
Browse files Browse the repository at this point in the history
Bump JDK to 21
  • Loading branch information
glennj authored Jan 20, 2025
2 parents 744da25 + 19e3b8e commit 8093862
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
12 changes: 5 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# === Build maven cache ===

FROM maven:3.8.3-jdk-11 AS cache
FROM maven:3.9.9-eclipse-temurin-21 AS cache

# Ensure exercise dependencies are downloaded
WORKDIR /opt/exercise
Expand All @@ -10,14 +10,12 @@ RUN mvn test dependency:go-offline -DexcludeReactor=false

# === Build runtime image ===

FROM maven:3.8.3-jdk-11-slim
FROM maven:3.9.9-eclipse-temurin-21-alpine
WORKDIR /opt/test-runner

RUN apt-get update && \
apt-get install -y jq && \
apt-get purge --auto-remove -y && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
RUN apk update && \
apk add --no-cache --upgrade jq sed grep && \
rm -rf /var/cache/apk/*

# Copy resources
COPY . .
Expand Down
4 changes: 2 additions & 2 deletions bin/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export JAVA_TOOL_OPTIONS="-Djansi.tmpdir=/solution/jansi-tmp -Xss128m -Xms256m -
rm -rf target
# Run the tests for the provided implementation file and redirect stdout and
# stderr to capture it
test_output=$(mvn --offline --legacy-local-repository --batch-mode --non-recursive --quiet test 2>&1)
test_output=$(mvn --offline --batch-mode --non-recursive --quiet test 2>&1)
exit_code=$?

rm -f pom.xml
Expand Down Expand Up @@ -103,7 +103,7 @@ else

# Manually add colors to the output to help scanning the output for errors
colorized_test_output=$(echo "${sanitized_output}" | \
GREP_COLOR='01;31' grep --color=always -E -e '^\[ERROR\].+$|$')
GREP_COLORS='mt=01;31' grep --color=always -E -e '^\[ERROR\].+$|$')

jq -n --arg output "${colorized_test_output}" '{version: 1, status: "fail", message: $output}' > ${results_file}
fi
Expand Down

0 comments on commit 8093862

Please sign in to comment.