This is an automated email from the ASF dual-hosted git repository.

rnewson pushed a commit to branch adoptium
in repository https://gitbox.apache.org/repos/asf/couchdb-ci.git

commit 0a68b256756e5120deda8c09c4a6878eb545f5c4
Author: Robert Newson <[email protected]>
AuthorDate: Mon Sep 29 19:03:48 2025 +0100

    switch to Adoptium packages for Java
---
 bin/apt-dependencies.sh     | 12 ++++++++++++
 build.sh                    |  4 ++++
 dockerfiles/debian-bookworm |  9 +--------
 dockerfiles/debian-bullseye |  9 +--------
 dockerfiles/debian-trixie   |  9 +--------
 dockerfiles/ubuntu-jammy    |  9 +--------
 dockerfiles/ubuntu-noble    |  9 +--------
 7 files changed, 21 insertions(+), 40 deletions(-)

diff --git a/bin/apt-dependencies.sh b/bin/apt-dependencies.sh
index 40dfc6e..8a8fd22 100755
--- a/bin/apt-dependencies.sh
+++ b/bin/apt-dependencies.sh
@@ -177,6 +177,18 @@ else
   apt-get install --no-install-recommends -y libffi-dev pkg-kde-tools 
autotools-dev
 fi
 
+# Configure Adoptium for Java
+apt-get update || true
+apt install -y wget apt-transport-https gpg
+wget -qO - https://packages.adoptium.net/artifactory/api/gpg/key/public | gpg 
--dearmor | tee /etc/apt/trusted.gpg.d/adoptium.gpg > /dev/null
+echo "deb https://packages.adoptium.net/artifactory/deb $(awk -F= 
'/^VERSION_CODENAME/{print$2}' /etc/os-release) main" | tee 
/etc/apt/sources.list.d/adoptium.list > /dev/null
+
+# Install JDKs
+apt update
+apt install -y temurin-${CLOUSEAU_JDK_VERSION}-jdk 
temurin-${NOUVEAU_JDK_VERSION}-jdk
+export JAVA_HOME=$(update-java-alternatives -l | grep "$NOUVEAU_JDK_VERSION" | 
awk '{print $3}')
+export CLOUSEAU_JAVA_HOME=$(update-java-alternatives -l | grep 
"$CLOUSEAU_JDK_VERSION" | awk '{print $3}')
+
 # Erlang is installed by apt-erlang.sh
 
 # clean up
diff --git a/build.sh b/build.sh
index 1ee74f8..469d58e 100755
--- a/build.sh
+++ b/build.sh
@@ -50,6 +50,10 @@ DEBIANS="debian-bullseye debian-bookworm debian-trixie"
 UBUNTUS="ubuntu-jammy ubuntu-noble"
 CENTOSES="almalinux-8 almalinux-9"
 
+# Java JDKs needed
+CLOUSEAU_JDK_VERSION="8"
+NOUVEAU_JDK_VERSION="21"
+
 PASSED_BUILDARGS="$buildargs"
 
 #  Allow overriding this list from the command line
diff --git a/dockerfiles/debian-bookworm b/dockerfiles/debian-bookworm
index 89e67b8..3210c84 100644
--- a/dockerfiles/debian-bookworm
+++ b/dockerfiles/debian-bookworm
@@ -21,14 +21,7 @@ ARG repository=debian
 
 FROM $repository:bookworm
 
-# Install Java
-ENV JAVA_HOME=/opt/java/openjdk
-COPY --from=eclipse-temurin:21 $JAVA_HOME $JAVA_HOME
-ENV PATH="${JAVA_HOME}/bin:${PATH}"
-
-# These are needed for the Clouseau integration
-ENV CLOUSEAU_JAVA_HOME=/opt/java/openjdk8
-COPY --from=ibm-semeru-runtimes:open-8-jre /opt/java/openjdk 
$CLOUSEAU_JAVA_HOME
+# This is needed for the Clouseau integration
 ENV PATH=/usr/local/lib/erlang/bin:"${PATH}"
 
 # Choose whether to install SpiderMonkey 1.8.5, default yes
diff --git a/dockerfiles/debian-bullseye b/dockerfiles/debian-bullseye
index eff092b..a726b7d 100644
--- a/dockerfiles/debian-bullseye
+++ b/dockerfiles/debian-bullseye
@@ -21,14 +21,7 @@ ARG repository=debian
 
 FROM $repository:bullseye
 
-# Install Java
-ENV JAVA_HOME=/opt/java/openjdk
-COPY --from=eclipse-temurin:21 $JAVA_HOME $JAVA_HOME
-ENV PATH="${JAVA_HOME}/bin:${PATH}"
-
-# These are needed for the Clouseau integration
-ENV CLOUSEAU_JAVA_HOME=/opt/java/openjdk8
-COPY --from=ibm-semeru-runtimes:open-8-jre /opt/java/openjdk 
$CLOUSEAU_JAVA_HOME
+# This is needed for the Clouseau integration
 ENV PATH=/usr/local/lib/erlang/bin:"${PATH}"
 
 # Choose whether to install SpiderMonkey 1.8.5, default yes
diff --git a/dockerfiles/debian-trixie b/dockerfiles/debian-trixie
index a8288e8..79ded2e 100644
--- a/dockerfiles/debian-trixie
+++ b/dockerfiles/debian-trixie
@@ -21,14 +21,7 @@ ARG repository=debian
 
 FROM $repository:trixie
 
-# Install Java
-ENV JAVA_HOME=/opt/java/openjdk
-COPY --from=eclipse-temurin:21 $JAVA_HOME $JAVA_HOME
-ENV PATH="${JAVA_HOME}/bin:${PATH}"
-
-# These are needed for the Clouseau integration
-ENV CLOUSEAU_JAVA_HOME=/opt/java/openjdk8
-COPY --from=ibm-semeru-runtimes:open-8-jre /opt/java/openjdk 
$CLOUSEAU_JAVA_HOME
+# This isneeded for the Clouseau integration
 ENV PATH=/usr/local/lib/erlang/bin:"${PATH}"
 
 # Choose whether to install SpiderMonkey 1.8.5, default yes
diff --git a/dockerfiles/ubuntu-jammy b/dockerfiles/ubuntu-jammy
index 98cb035..b0ce23b 100644
--- a/dockerfiles/ubuntu-jammy
+++ b/dockerfiles/ubuntu-jammy
@@ -19,14 +19,7 @@
 
 FROM ubuntu:jammy
 
-# Install Java
-ENV JAVA_HOME=/opt/java/openjdk
-COPY --from=eclipse-temurin:21 $JAVA_HOME $JAVA_HOME
-ENV PATH="${JAVA_HOME}/bin:${PATH}"
-
-# These are needed for the Clouseau integration
-ENV CLOUSEAU_JAVA_HOME=/opt/java/openjdk8
-COPY --from=ibm-semeru-runtimes:open-8-jre /opt/java/openjdk 
$CLOUSEAU_JAVA_HOME
+# This is needed for the Clouseau integration
 ENV PATH=/usr/local/lib/erlang/bin:"${PATH}"
 
 # Choose whether to install SpiderMonkey 1.8.5, default yes
diff --git a/dockerfiles/ubuntu-noble b/dockerfiles/ubuntu-noble
index da41d91..886557f 100644
--- a/dockerfiles/ubuntu-noble
+++ b/dockerfiles/ubuntu-noble
@@ -19,14 +19,7 @@
 
 FROM ubuntu:noble
 
-# Install Java
-ENV JAVA_HOME=/opt/java/openjdk
-COPY --from=eclipse-temurin:21 $JAVA_HOME $JAVA_HOME
-ENV PATH="${JAVA_HOME}/bin:${PATH}"
-
-# These are needed for the Clouseau integration
-ENV CLOUSEAU_JAVA_HOME=/opt/java/openjdk8
-COPY --from=ibm-semeru-runtimes:open-8-jre /opt/java/openjdk 
$CLOUSEAU_JAVA_HOME
+# This is needed for the Clouseau integration
 ENV PATH=/usr/local/lib/erlang/bin:"${PATH}"
 
 # Choose whether to install SpiderMonkey 1.8.5, default yes

Reply via email to