Skip to content

Commit

Permalink
Merge pull request #2132 from travis-ci/kw-semeru
Browse files Browse the repository at this point in the history
Adding semeru jdk vendor
  • Loading branch information
smokodon authored Jul 15, 2024
2 parents a5a2839 + e386884 commit 0a9dd66
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
46 changes: 46 additions & 0 deletions lib/travis/build/bash/travis_install_jdk.bash
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ travis_install_jdk() {
if [[ "$vendor" == "eclipse" ]]; then
vm="openj9"
travis_install_jdk_package_adoptium "$version" "$vm"
elif [[ "$vendor" == "semeru" ]]; then
travis_install_jdk_package_semeru "$version"
else
case "${TRAVIS_CPU_ARCH}" in
"s390x" | "ppc64le")
Expand Down Expand Up @@ -102,3 +104,47 @@ travis_install_jdk_package_bellsoft() {
fi
fi
}

# Provider for SEMERU vendor
travis_install_jdk_package_semeru() {
local JAVA_VERSION
JAVA_VERSION="$1"

if [[ "${TRAVIS_CPU_ARCH}" == "arm64" ]]; then
TRAVIS_CPU_ARCH="aarch64"
elif [[ "${TRAVIS_CPU_ARCH}" == "amd64" ]]; then
TRAVIS_CPU_ARCH="x64"
fi

case "${JAVA_VERSION}" in
8) JDK_URL="https://github.com/ibmruntimes/semeru8-binaries/releases/download/jdk8u412-b08_openj9-0.44.0/ibm-semeru-open-jdk_${TRAVIS_CPU_ARCH}_linux_8u412b08_openj9-0.44.0.tar.gz" ;;
11) JDK_URL="https://github.com/ibmruntimes/semeru11-binaries/releases/download/jdk-11.0.23%2B9_openj9-0.44.0/ibm-semeru-open-jdk_${TRAVIS_CPU_ARCH}_linux_11.0.23_9_openj9-0.44.0.tar.gz" ;;
16) JDK_URL="https://github.com/ibmruntimes/semeru16-binaries/releases/download/jdk-16.0.2%2B7_openj9-0.27.0/ibm-semeru-open-jdk_${TRAVIS_CPU_ARCH}_linux_16.0.2_7_openj9-0.27.0.tar.gz" ;;
17) JDK_URL="https://github.com/ibmruntimes/semeru17-binaries/releases/download/jdk-17.0.11%2B9_openj9-0.44.0/ibm-semeru-open-jdk_${TRAVIS_CPU_ARCH}_linux_17.0.11_9_openj9-0.44.0.tar.gz" ;;
18) JDK_URL="https://github.com/ibmruntimes/semeru18-binaries/releases/download/jdk-18.0.2%2B9_openj9-0.33.1/ibm-semeru-open-jdk_${TRAVIS_CPU_ARCH}_linux_18.0.2_9_openj9-0.33.1.tar.gz" ;;
19) JDK_URL="https://github.com/ibmruntimes/semeru19-binaries/releases/download/jdk-19.0.2%2B7_openj9-0.37.0/ibm-semeru-open-jdk_${TRAVIS_CPU_ARCH}_linux_19.0.2_7_openj9-0.37.0.tar.gz" ;;
20) JDK_URL="https://github.com/ibmruntimes/semeru20-binaries/releases/download/jdk-20.0.2%2B9_openj9-0.40.0/ibm-semeru-open-jdk_${TRAVIS_CPU_ARCH}_linux_20.0.2_9_openj9-0.40.0.tar.gz" ;;
21) JDK_URL="https://github.com/ibmruntimes/semeru21-binaries/releases/download/jdk-21.0.3%2B9_openj9-0.44.0/ibm-semeru-open-jdk_${TRAVIS_CPU_ARCH}_linux_21.0.3_9_openj9-0.44.0.tar.gz" ;;
22) JDK_URL="https://github.com/ibmruntimes/semeru22-binaries/releases/download/jdk-22.0.1%2B8_openj9-0.45.0/ibm-semeru-open-jdk_${TRAVIS_CPU_ARCH}_linux_22.0.1_8_openj9-0.45.0.tar.gz" ;;
*) echo "JDK ${JAVA_VERSION} missing in the Semeru repository. Please choose a different version." ;;
esac

# Define the installation directory
INSTALL_DIR="/usr/lib/jvm"

# Download the JDK tarball
wget -q "$JDK_URL" -O jdk.tar.gz

# Extract the tarball
sudo mkdir $INSTALL_DIR/jdk"${JAVA_VERSION}" && sudo tar -xzf jdk.tar.gz --strip-components 1 -C "$INSTALL_DIR/jdk${JAVA_VERSION}"

export JAVA_HOME="$INSTALL_DIR/jdk${JAVA_VERSION}"
export PATH=$JAVA_HOME/bin:$PATH

# shellcheck source=/dev/null
source ~/.bashrc

# Verify Java version
java --version

}
2 changes: 2 additions & 0 deletions lib/travis/build/script/shared/jdk.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ def jdk_info(jdk)
vendor = 'openjdk'
elsif m[:vendor].start_with? 'eclipse'
vendor = 'eclipse'
elsif m[:vendor].start_with? 'semeru'
vendor = 'semeru'
end
[ vendor, m[:version] ]
end
Expand Down

0 comments on commit 0a9dd66

Please sign in to comment.