Skip to content

Commit

Permalink
#21 Update Java compatibility to 11 (#22) and catch verifier failures…
Browse files Browse the repository at this point in the history
… correctly.

#21 Update Java compatibility to 11 (#22) and catch verifier failures correctly.

Co-authored-by: Chris Carini <6374067+ChrisCarini@users.noreply.github.com>
  • Loading branch information
sadv1r and ChrisCarini authored Jul 11, 2021
1 parent 4a99296 commit 6e5251e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# OpenJDK image with Java 1.8 JDK installed on an Alpine Linux base image.
# AdoptOpenJDK image with Java 11 JDK installed on an Alpine Linux base image.
# We want an Alpine Linux base image to keep the overall image size small.
# We want a Java 1.8 JDK image as the verifier CLI needs a JDK (as opposed to a JRE).
# We want a Java 11 JDK image as the verifier CLI needs a JDK (as opposed to a JRE).
#
# Ref: https://hub.docker.com/_/openjdk
# Ref: https://hub.docker.com/layers/openjdk/library/openjdk/8-jdk-alpine/images/sha256-210ecd2595991799526a62a7099718b149e3bbefdb49764cc2a450048e0dd4c0?context=explore
FROM openjdk:8-jdk-alpine
# Ref: https://hub.docker.com/_/adoptopenjdk
# Ref: https://hub.docker.com/layers/adoptopenjdk/openjdk11/alpine-slim/images/sha256-ef65f9b755ba9d70580d3b5e4ea7f133c68cecc096171959d011b38c4728f6b2?context=explore
FROM adoptopenjdk/openjdk11:alpine-slim

# We prefer bash for our script, so let's install that
RUN apk --no-cache add bash
Expand Down
9 changes: 5 additions & 4 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,9 @@ gh_debug "VERIFIER_JAR_LOCATION => $VERIFIER_JAR_LOCATION"
##

# Set the correct JAVA_HOME path for the container because this is overwritten by the setup-java action.
# We use the docker image `openjdk:8-jdk-alpine` - https://hub.docker.com/layers/openjdk/library/openjdk/8-jdk-alpine/images/sha256-210ecd2595991799526a62a7099718b149e3bbefdb49764cc2a450048e0dd4c0?context=explore
# and pull the `JAVA_HOME` property from it's image (ie, its definition has `ENV JAVA_HOME=/usr/lib/jvm/java-1.8-openjdk`).
JAVA_HOME="/usr/lib/jvm/java-1.8-openjdk"
# We use the docker image `adoptopenjdk/openjdk11:alpine-slim` - https://hub.docker.com/layers/adoptopenjdk/openjdk11/alpine-slim/images/sha256-ef65f9b755ba9d70580d3b5e4ea7f133c68cecc096171959d011b38c4728f6b2?context=explore
# and pull the `JAVA_HOME` property from it's image (ie, its definition has `ENV JAVA_HOME=/opt/java/openjdk`).
JAVA_HOME="/opt/java/openjdk"

# The location of the plugin
PLUGIN_LOCATION="$GITHUB_WORKSPACE/$INPUT_PLUGIN_LOCATION"
Expand Down Expand Up @@ -439,7 +439,8 @@ set +o errexit

# shellcheck disable=SC2086
java -jar "$VERIFIER_JAR_LOCATION" check-plugin $PLUGIN_LOCATION $IDE_DIRECTORIES 2>&1 | tee "$VERIFICATION_OUTPUT_LOG"
VERIFICATION_SUCCESSFUL=$?
# We use `${PIPESTATUS[0]}` here instead of `$?` as the later returns the status code for the `tee` call, and we want the status code of the `java` invocation of the verifier, which `${PIPESTATUS[0]}` provides.
VERIFICATION_SUCCESSFUL=${PIPESTATUS[0]}

# Restore 'exit on error', as the test is over.
set -o errexit
Expand Down

0 comments on commit 6e5251e

Please sign in to comment.