From f55f08cc50451f6ea7477d0102859624ca972cf2 Mon Sep 17 00:00:00 2001 From: andrew-m-leonard Date: Wed, 26 Feb 2020 12:26:12 +0000 Subject: [PATCH] Enable Corretto builds Signed-off-by: andrew-m-leonard --- configureBuild.sh | 7 +----- pipelines/jobs/configurations/jdk11u.groovy | 5 ++-- pipelines/jobs/configurations/jdk8u.groovy | 3 ++- sbin/build.sh | 28 +++++++++++---------- sbin/common/config_init.sh | 2 +- 5 files changed, 22 insertions(+), 23 deletions(-) diff --git a/configureBuild.sh b/configureBuild.sh index 35668685e..428c1a6a3 100755 --- a/configureBuild.sh +++ b/configureBuild.sh @@ -167,12 +167,7 @@ setRepository() { suffix="SAP/SapMachine"; elif [[ "${BUILD_CONFIG[BUILD_VARIANT]}" == "${BUILD_VARIANT_CORRETTO}" ]] then - if [ "${BUILD_CONFIG[OPENJDK_CORE_VERSION]}" == "${JDK8_CORE_VERSION}" ]; then - suffix="corretto/corretto-8"; - else - echo "Adopt only currently supports corretto for JDK8" - exit 1 - fi + suffix="corretto/corretto-${BUILD_CONFIG[OPENJDK_CORE_VERSION]:3}" elif [ "${BUILD_CONFIG[OPENJDK_CORE_VERSION]}" == "${JDK8_CORE_VERSION}" ] && [ "${BUILD_CONFIG[OS_ARCHITECTURE]}" == "armv7l" ]; then suffix="adoptopenjdk/openjdk-aarch32-jdk8u"; else diff --git a/pipelines/jobs/configurations/jdk11u.groovy b/pipelines/jobs/configurations/jdk11u.groovy index 05510acb0..cfc568307 100644 --- a/pipelines/jobs/configurations/jdk11u.groovy +++ b/pipelines/jobs/configurations/jdk11u.groovy @@ -8,7 +8,8 @@ targetConfigurations = [ ], "x64Linux" : [ "hotspot", - "openj9" + "openj9", + "corretto" ], "x64Windows" : [ "hotspot", @@ -56,4 +57,4 @@ targetConfigurations = [ // 23:30 triggerSchedule="TZ=UTC\n30 23 * * *" -return this \ No newline at end of file +return this diff --git a/pipelines/jobs/configurations/jdk8u.groovy b/pipelines/jobs/configurations/jdk8u.groovy index 5007bf4ff..73385047a 100644 --- a/pipelines/jobs/configurations/jdk8u.groovy +++ b/pipelines/jobs/configurations/jdk8u.groovy @@ -6,7 +6,8 @@ targetConfigurations = [ "x64Linux" : [ "hotspot", "hotspot-jfr", - "openj9" + "openj9", + "corretto" ], "x32Windows" : [ "hotspot", diff --git a/sbin/build.sh b/sbin/build.sh index 7124ee749..577b80f89 100755 --- a/sbin/build.sh +++ b/sbin/build.sh @@ -132,20 +132,22 @@ getOpenJdkVersion() { local version; if [ "${BUILD_CONFIG[BUILD_VARIANT]}" == "${BUILD_VARIANT_CORRETTO}" ]; then - local updateRegex="UPDATE_VERSION=([0-9]+)"; - local buildRegex="BUILD_NUMBER=b([0-9]+)"; - - local versionData="$(tr '\n' ' ' < ${BUILD_CONFIG[WORKSPACE_DIR]}/${BUILD_CONFIG[WORKING_DIR]}/${BUILD_CONFIG[OPENJDK_SOURCE_DIR]}/version.spec)" - - local updateNum - local buildNum - if [[ "${versionData}" =~ $updateRegex ]]; then - updateNum="${BASH_REMATCH[1]}" - fi - if [[ "${versionData}" =~ $buildRegex ]]; then - buildNum="${BASH_REMATCH[1]}" + local corrVerFile=${BUILD_CONFIG[WORKSPACE_DIR]}/${BUILD_CONFIG[WORKING_DIR]}/${BUILD_CONFIG[OPENJDK_SOURCE_DIR]}/version.txt + + local corrVersion="$(cut -d'.' -f 1 < ${corrVerFile})" + + if [ "${corrVersion}" == "8" ]; then + local updateNum="$(cut -d'.' -f 2 < ${corrVerFile})" + local buildNum="$(cut -d'.' -f 3 < ${corrVerFile})" + local fixNum="$(cut -d'.' -f 4 < ${corrVerFile})" + version="jdk8u${updateNum}-b${buildNum}.${fixNum}" + else + local minorNum="$(cut -d'.' -f 2 < ${corrVerFile})" + local updateNum="$(cut -d'.' -f 3 < ${corrVerFile})" + local buildNum="$(cut -d'.' -f 4 < ${corrVerFile})" + local fixNum="$(cut -d'.' -f 5 < ${corrVerFile})" + version="jdk-${corrVersion}.${minorNum}.${updateNum}+${buildNum}.${fixNum}" fi - version="8u${updateNum}-b${buildNum}" else version=${BUILD_CONFIG[TAG]:-$(getFirstTagFromOpenJDKGitRepo)} diff --git a/sbin/common/config_init.sh b/sbin/common/config_init.sh index 75f059c3f..8b1c184b3 100755 --- a/sbin/common/config_init.sh +++ b/sbin/common/config_init.sh @@ -304,7 +304,7 @@ function setBranch() { if [ "${BUILD_CONFIG[BUILD_VARIANT]}" == "${BUILD_VARIANT_OPENJ9}" ]; then branch="openj9"; elif [ "${BUILD_CONFIG[BUILD_VARIANT]}" == "${BUILD_VARIANT_CORRETTO}" ]; then - branch="preview-release"; + branch="develop"; fi BUILD_CONFIG[BRANCH]=${BUILD_CONFIG[BRANCH]:-$branch}