Skip to content

Commit

Permalink
Support Artifactoriy SDK URL for releases
Browse files Browse the repository at this point in the history
Signed-off-by: Lan Xia <[email protected]>
  • Loading branch information
llxia committed Oct 11, 2024
1 parent c9db601 commit 2e2f9e9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
2 changes: 1 addition & 1 deletion buildenv/jenkins/JenkinsfileBase
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ def setup() {
stage('Setup') {
setupEnv()
if (params.CUSTOMIZED_SDK_URL) {
if (params.SDK_RESOURCE == 'nightly') {
if (params.SDK_RESOURCE == 'nightly' || params.SDK_RESOURCE == 'releases') {
// remove single quote to allow variables to be set in CUSTOMIZED_SDK_URL
CUSTOMIZED_SDK_URL_OPTION = "-c ${params.CUSTOMIZED_SDK_URL}"
} else if (!params.SDK_RESOURCE || params.SDK_RESOURCE == 'customized') {
Expand Down
21 changes: 18 additions & 3 deletions get.sh
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ getBinaryOpenjdk()
curl_options="--user $USERNAME:$PASSWORD"
fi


if [ "$SDK_RESOURCE" == "nightly" ] && [ "$CUSTOMIZED_SDK_URL" != "" ]; then
result=$(curl -k ${curl_options} ${CUSTOMIZED_SDK_URL} | grep ">[0-9]*\/<" | sed -e 's/[^0-9/ ]//g' | sed 's/\/.*$//')
IFS=' ' read -r -a array <<< "$result"
Expand All @@ -201,7 +202,7 @@ getBinaryOpenjdk()
download_url+=" ${latestBuildUrl}${n}"
fi
done
elif [ "$CUSTOMIZED_SDK_URL" != "" ]; then
elif [ "$SDK_RESOURCE" == "customized" ] && [ "$CUSTOMIZED_SDK_URL" != "" ]; then
download_url=$CUSTOMIZED_SDK_URL
images="test-images.tar.gz debug-image.tar.gz"
download_urls=($download_url)
Expand Down Expand Up @@ -244,9 +245,23 @@ getBinaryOpenjdk()
if [ "$SDK_RESOURCE" = "nightly" ]; then
echo "Semeru API does not provide openj9 SDK nightly at the moment. Please use CUSTOMIZED_SDK_URL to provide the SDK URL directly."
exit 1
elif [ "$CUSTOMIZED_SDK_URL" == "" ]; then
echo "Please use CUSTOMIZED_SDK_URL to provide the base SDK URL for Artifactory."
exit 1
else
download_url="https://ibm.com/semeru-runtimes/api/v3/binary/latest/${JDK_VERSION}/${release_type}/${os}/${arch}/jdk/openj9/${heap_size}/ibm https://ibm.com/semeru-runtimes/api/v3/binary/latest/${JDK_VERSION}/${release_type}/${os}/${arch}/testimage/openj9/${heap_size}/ibm"
info_url="https://ibm.com/semeru-runtimes/api/v3/assets/feature_releases/${JDK_VERSION}/${release_type}?architecture=${arch}&heap_size=${heap_size}&image_type=jdk&jvm_impl=openj9&os=${os}&project=jdk&vendor=ibm https://ibm.com/semeru-runtimes/api/v3/assets/feature_releases/${JDK_VERSION}/${release_type}?architecture=${arch}&heap_size=${heap_size}&image_type=testimage&jvm_impl=openj9&os=${os}&project=jdk&vendor=ibm"
download_url_base="${CUSTOMIZED_SDK_URL}${arch}_${os}/"
echo "downloading files from ${download_url_base}"
download_urls=$(curl -k ${curl_options} ${download_url_base} | grep -E ">.*pax<|>.*tar.gz<|>.*zip<" | grep -Ei ">.*test.*image.*<|>.*jdk.*<" | sed 's/^.*">//' | sed 's/<\/a>.*//')
arr=(${download_urls/ / })
download_url=()
for n in "${arr[@]}" ; do
required=true
checkURL "$n"
if [ $required != false ]; then
download_url+=" ${download_url_base}${n}"
fi
done
echo "download_url : ${download_url}"
fi
else
download_url="https://api.adoptium.net/v3/binary/latest/${JDK_VERSION}/${release_type}/${os}/${arch}/jdk/${JDK_IMPL}/${heap_size}/adoptium?project=jdk https://api.adoptium.net/v3/binary/latest/${JDK_VERSION}/${release_type}/${os}/${arch}/sbom/${JDK_IMPL}/${heap_size}/adoptium?project=jdk"
Expand Down

0 comments on commit 2e2f9e9

Please sign in to comment.