Skip to content

Commit 8093862

Browse files
authored
Merge pull request #43 from artamonovkirill/bump/java-21
Bump JDK to 21
2 parents 744da25 + 19e3b8e commit 8093862

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

Dockerfile

+5-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# === Build maven cache ===
22

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

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

1111
# === Build runtime image ===
1212

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

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

2220
# Copy resources
2321
COPY . .

bin/run.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export JAVA_TOOL_OPTIONS="-Djansi.tmpdir=/solution/jansi-tmp -Xss128m -Xms256m -
7070
rm -rf target
7171
# Run the tests for the provided implementation file and redirect stdout and
7272
# stderr to capture it
73-
test_output=$(mvn --offline --legacy-local-repository --batch-mode --non-recursive --quiet test 2>&1)
73+
test_output=$(mvn --offline --batch-mode --non-recursive --quiet test 2>&1)
7474
exit_code=$?
7575

7676
rm -f pom.xml
@@ -103,7 +103,7 @@ else
103103

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

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

0 commit comments

Comments
 (0)