Skip to content

Commit

Permalink
chore(jdk21-preview): don't hardcode JAVA_MAJOR_VERSION in release …
Browse files Browse the repository at this point in the history
…URL (#1753)
  • Loading branch information
lemeurherve authored Oct 24, 2023
1 parent 4bbd49d commit d818fc7
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
7 changes: 4 additions & 3 deletions 21/debian/bookworm-slim/hotspot/preview/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ARG TARGETPLATFORM
SHELL ["/bin/bash", "-o", "pipefail", "-c"]

## Example of preview (EA) jdk21 JAVA_VERSION values:
# 21+35 (special case)
# 21+35 (note: only one number before the "+")
# 21.0.1+12
## Example of preview (EA) release download link:
# https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21%2B35-ea-beta/OpenJDK21U-jdk_x64_linux_hotspot_ea_21-0-35.tar.gz
Expand All @@ -16,10 +16,11 @@ RUN set -x; apt-get update \
ca-certificates \
jq \
wget \
&& DASHED_JAVA_VERSION=$(echo "${JAVA_VERSION}" | sed -e 's/\./-/g' -e 's/+/-/' -e 's/21-35/21-0-35/') \
&& DASHED_JAVA_VERSION=$(echo "$JAVA_VERSION" | sed -e 's/\./-/g' -e 's/+/-/' -e 's/21-35/21-0-35/') \
&& JAVA_MAJOR_VERSION=$(echo "$JAVA_VERSION" | cut -d'+' -f1 | cut -d'.' -f1) \
&& ENCODED_JAVA_VERSION=$(echo "$JAVA_VERSION" | jq "@uri" -jRr) \
&& CONVERTED_ARCH=$(arch | sed -e 's/x86_64/x64/' -e 's/armv7l/arm/') \
&& wget --quiet https://github.com/adoptium/temurin21-binaries/releases/download/jdk-"${ENCODED_JAVA_VERSION}"-ea-beta/OpenJDK21U-jdk_"${CONVERTED_ARCH}"_linux_hotspot_ea_"${DASHED_JAVA_VERSION}".tar.gz -O /tmp/jdk.tar.gz \
&& wget --quiet https://github.com/adoptium/temurin"${JAVA_MAJOR_VERSION}"-binaries/releases/download/jdk-"${ENCODED_JAVA_VERSION}"-ea-beta/OpenJDK"${JAVA_MAJOR_VERSION}"U-jdk_"${CONVERTED_ARCH}"_linux_hotspot_ea_"${DASHED_JAVA_VERSION}".tar.gz -O /tmp/jdk.tar.gz \
&& tar -xzf /tmp/jdk.tar.gz -C /opt/ \
&& rm -f /tmp/jdk.tar.gz

Expand Down
7 changes: 4 additions & 3 deletions 21/debian/bookworm/hotspot/preview/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ARG TARGETPLATFORM
SHELL ["/bin/bash", "-o", "pipefail", "-c"]

## Example of preview (EA) jdk21 JAVA_VERSION values:
# 21+35 (special case)
# 21+35 (note: only one number before the "+")
# 21.0.1+12
## Example of preview (EA) release download link:
# https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21%2B35-ea-beta/OpenJDK21U-jdk_x64_linux_hotspot_ea_21-0-35.tar.gz
Expand All @@ -16,10 +16,11 @@ RUN set -x; apt-get update \
ca-certificates \
jq \
wget \
&& DASHED_JAVA_VERSION=$(echo "${JAVA_VERSION}" | sed -e 's/\./-/g' -e 's/+/-/' -e 's/21-35/21-0-35/') \
&& DASHED_JAVA_VERSION=$(echo "$JAVA_VERSION" | sed -e 's/\./-/g' -e 's/+/-/' -e 's/21-35/21-0-35/') \
&& JAVA_MAJOR_VERSION=$(echo "$JAVA_VERSION" | cut -d'+' -f1 | cut -d'.' -f1) \
&& ENCODED_JAVA_VERSION=$(echo "$JAVA_VERSION" | jq "@uri" -jRr) \
&& CONVERTED_ARCH=$(arch | sed -e 's/x86_64/x64/' -e 's/armv7l/arm/') \
&& wget --quiet https://github.com/adoptium/temurin21-binaries/releases/download/jdk-"${ENCODED_JAVA_VERSION}"-ea-beta/OpenJDK21U-jdk_"${CONVERTED_ARCH}"_linux_hotspot_ea_"${DASHED_JAVA_VERSION}".tar.gz -O /tmp/jdk.tar.gz \
&& wget --quiet https://github.com/adoptium/temurin"${JAVA_MAJOR_VERSION}"-binaries/releases/download/jdk-"${ENCODED_JAVA_VERSION}"-ea-beta/OpenJDK"${JAVA_MAJOR_VERSION}"U-jdk_"${CONVERTED_ARCH}"_linux_hotspot_ea_"${DASHED_JAVA_VERSION}".tar.gz -O /tmp/jdk.tar.gz \
&& tar -xzf /tmp/jdk.tar.gz -C /opt/ \
&& rm -f /tmp/jdk.tar.gz

Expand Down
7 changes: 4 additions & 3 deletions 21/rhel/ubi9/hotspot/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,17 @@ ARG TARGETPLATFORM
SHELL ["/bin/bash", "-o", "pipefail", "-c"]

## Example of preview (EA) jdk21 JAVA_VERSION values:
# 21+35 (special case)
# 21+35 (note: only one number before the "+")
# 21.0.1+12
## Example of preview (EA) release download link:
# https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21%2B35-ea-beta/OpenJDK21U-jdk_x64_linux_hotspot_ea_21-0-35.tar.gz
# https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.1%2B12-ea-beta/OpenJDK21U-jdk_x64_alpine-linux_hotspot_ea_21-0-1-12.tar.gz
RUN set -x; yum install -y jq wget \
&& DASHED_JAVA_VERSION=$(echo "${JAVA_VERSION}" | sed -e 's/\./-/g' -e 's/+/-/' -e 's/21-35/21-0-35/') \
&& DASHED_JAVA_VERSION=$(echo "$JAVA_VERSION" | sed -e 's/\./-/g' -e 's/+/-/' -e 's/21-35/21-0-35/') \
&& JAVA_MAJOR_VERSION=$(echo "$JAVA_VERSION" | cut -d'+' -f1 | cut -d'.' -f1) \
&& ENCODED_JAVA_VERSION=$(echo "$JAVA_VERSION" | jq "@uri" -jRr) \
&& CONVERTED_ARCH=$(arch | sed 's/x86_64/x64/') \
&& wget --quiet https://github.com/adoptium/temurin21-binaries/releases/download/jdk-"${ENCODED_JAVA_VERSION}"-ea-beta/OpenJDK21U-jdk_"${CONVERTED_ARCH}"_linux_hotspot_ea_"${DASHED_JAVA_VERSION}".tar.gz -O /tmp/jdk.tar.gz \
&& wget --quiet https://github.com/adoptium/temurin"${JAVA_MAJOR_VERSION}"-binaries/releases/download/jdk-"${ENCODED_JAVA_VERSION}"-ea-beta/OpenJDK"${JAVA_MAJOR_VERSION}"U-jdk_"${CONVERTED_ARCH}"_linux_hotspot_ea_"${DASHED_JAVA_VERSION}".tar.gz -O /tmp/jdk.tar.gz \
&& yum clean all \
&& tar -xzf /tmp/jdk.tar.gz -C /opt/ \
&& rm -f /tmp/jdk.tar.gz
Expand Down

0 comments on commit d818fc7

Please sign in to comment.