Skip to content

Commit

Permalink
[ubicloud] Try installing java till it is succeeded
Browse files Browse the repository at this point in the history
Server for temurin java is flaky, it sometimes return error while trying
to install it. Sample error is given below

`
Failed to fetch https://packages.adoptium.net/artifactory/deb/pool/main/t/temurin-8/temurin-8-jdk_8.0.422.0.0+5_arm64.deb
Connection failed [IP: 104.18.20.66 443]
`

So, try installing via loop to make sure it is installed.
  • Loading branch information
velioglu committed Oct 11, 2024
1 parent c59a1c8 commit b565f42
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion images/ubuntu/scripts/build/install-java-tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ install_open_jdk() {
local java_version=$1

# Install Java from PPA repositories.
apt-get -y install temurin-${java_version}-jdk=\*
while ! apt-get -y install temurin-${java_version}-jdk=\*; do
echo "Installation of temurin-${java_version}-jdk failed. Retrying in 5 seconds..."
sleep 5
done

java_version_path="/usr/lib/jvm/temurin-${java_version}-jdk-$(get_arch "amd64" "arm64")"

java_toolcache_path="${AGENT_TOOLSDIRECTORY}/Java_Temurin-Hotspot_jdk"
Expand Down

0 comments on commit b565f42

Please sign in to comment.