-
-
Notifications
You must be signed in to change notification settings - Fork 256
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added feature to download boot jdk on demand
currenlty only dne for linux, shoudl be easy to extend for windows, not sure what whith other platfroms. Is done via magic parameter of `download` for -J: -J download
- Loading branch information
Showing
4 changed files
with
109 additions
and
65 deletions.
There are no files selected for viewing
84 changes: 84 additions & 0 deletions
84
build-farm/platform-specific-configurations/downloaders.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
#!/bin/bash | ||
# shellcheck disable=SC1091 | ||
|
||
################################################################################ | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# https://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
################################################################################ | ||
|
||
DOWLOADERS_SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
|
||
# this one should be swithing per (supported) oses in future | ||
function downloadBootJDK() { | ||
downloadLinuxBootJDK "$@" | ||
} | ||
|
||
function downloadLinuxBootJDK() { | ||
ARCH=$1 | ||
VER=$2 | ||
export downloadArch | ||
case "$ARCH" in | ||
"riscv64") downloadArch="$NATIVE_API_ARCH";; | ||
*) downloadArch="$ARCH";; | ||
esac | ||
releaseType="ga" | ||
vendor="eclipse" | ||
apiUrlTemplate="https://api.adoptium.net/v3/binary/latest/\${VER}/\${releaseType}/linux/\${downloadArch}/jdk/hotspot/normal/\${vendor}" | ||
apiURL=$(eval echo "${apiUrlTemplate}") | ||
echo "Downloading GA release of boot JDK version ${VER} from ${apiURL}" | ||
# make-adopt-build-farm.sh has 'set -e'. We need to disable that for | ||
# the fallback mechanism, as downloading of the GA binary might fail. | ||
set +e | ||
curl -L -o bootjdk.tar.gz "${apiURL}" | ||
apiSigURL=$(curl -v "${apiURL}" 2>&1 | tr -d \\r | awk '/^< Location:/{print $3 ".sig"}') | ||
if ! grep "No releases match the request" bootjdk.tar.gz; then | ||
curl -L -o bootjdk.tar.gz.sig "${apiSigURL}" | ||
gpg --keyserver keyserver.ubuntu.com --recv-keys 3B04D753C9050D9A5D343F39843C48A565F8F04B | ||
echo -e "5\ny\n" | gpg --batch --command-fd 0 --expert --edit-key 3B04D753C9050D9A5D343F39843C48A565F8F04B trust; | ||
gpg --verify bootjdk.tar.gz.sig bootjdk.tar.gz || exit 1 | ||
mkdir "$bootDir" | ||
tar xpzf bootjdk.tar.gz --strip-components=1 -C "$bootDir" | ||
set -e | ||
else | ||
# We must be a JDK HEAD build for which no boot JDK exists other than | ||
# nightlies? | ||
echo "Downloading GA release of boot JDK version ${VER} failed." | ||
# shellcheck disable=SC2034 | ||
releaseType="ea" | ||
# shellcheck disable=SC2034 | ||
vendor="adoptium" | ||
apiURL=$(eval echo ${apiUrlTemplate}) | ||
echo "Attempting to download EA release of boot JDK version ${VER} from ${apiURL}" | ||
set +e | ||
curl -L -o bootjdk.tar.gz "${apiURL}" | ||
if ! grep "No releases match the request" bootjdk.tar.gz; then | ||
apiSigURL=$(curl -v "${apiURL}" 2>&1 | tr -d \\r | awk '/^< Location:/{print $3 ".sig"}') | ||
curl -L -o bootjdk.tar.gz.sig "${apiSigURL}" | ||
gpg --keyserver keyserver.ubuntu.com --recv-keys 3B04D753C9050D9A5D343F39843C48A565F8F04B | ||
echo -e "5\ny\n" | gpg --batch --command-fd 0 --expert --edit-key 3B04D753C9050D9A5D343F39843C48A565F8F04B trust; | ||
gpg --verify bootjdk.tar.gz.sig bootjdk.tar.gz || exit 1 | ||
mkdir "$bootDir" | ||
tar xpzf bootjdk.tar.gz --strip-components=1 -C "$bootDir" | ||
else | ||
# If no binaries are available then try from adoptopenjdk | ||
echo "Downloading Temurin release of boot JDK version ${VER} failed." | ||
# shellcheck disable=SC2034 | ||
releaseType="ga" | ||
# shellcheck disable=SC2034 | ||
vendor="adoptium" | ||
apiURL=$(eval echo ${apiUrlTemplate}) | ||
echo "Attempting to download GA release of boot JDK version ${VER} from ${apiURL}" | ||
curl -L "${apiURL}" | tar xpzf - --strip-components=1 -C "$bootDir" | ||
fi | ||
fi | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters