From 0a84e5537ef251ced8df67b0f4a096bcc981ee76 Mon Sep 17 00:00:00 2001 From: Andrew Leonard Date: Mon, 2 Dec 2024 10:14:46 +0000 Subject: [PATCH 01/10] Make trigger_beta job check specific jdk8u aarch32 and alpine assests exist Signed-off-by: Andrew Leonard --- .../build/common/trigger_beta_build.groovy | 76 ++++++++++++++++--- 1 file changed, 66 insertions(+), 10 deletions(-) diff --git a/pipelines/build/common/trigger_beta_build.groovy b/pipelines/build/common/trigger_beta_build.groovy index 947ac2435..119cd9364 100644 --- a/pipelines/build/common/trigger_beta_build.groovy +++ b/pipelines/build/common/trigger_beta_build.groovy @@ -114,6 +114,53 @@ def loadTargetConfigurations(String javaVersion, String variant, String configSe return targetConfigurationsForVariant } +// Verify the given published release tag contains the given asset architecture +def checkJDKAssetExistsForArch(String version, String release, String variant, String arch) { + def assetExists = false + + echo "Verifying ${version} assets in release: ${release}" + + def publishVersion = version + // aarch32-jdk8u and alpine-jdk8u published as "jdk8u" tags + if (version == "aarch32-jdk8u" || version == "alpine-jdk8u") { + publishVersion = "jdk8u" + } + + def escRelease = release.replaceAll("\\+", "%2B") + def releaseAssetsUrl = "${binariesRepo}/releases/tags/${escRelease}".replaceAll("_NN_", publishVersion.replaceAll("[a-z]","")) + + // Get list of assets, concatenate into a single string + def rc = sh(script: 'rm -f releaseAssets.json && curl -L -o releaseAssets.json '+releaseAssetsUrl, returnStatus: true) + def releaseAssets = "" + if (rc == 0) { + releaseAssets = sh(script: "cat releaseAssets.json | grep '\"name\"' | tr '\\n' '#'", returnStdout: true) + } + + if (releaseAssets == "") { + echo "No release assets for ${releaseAssetsUrl}" + } else { + // Work out the JDK artifact filetype + def filetype + if (osarch.contains("Windows")) { + filetype = "\\.zip" + } else { + filetype = "\\.tar\\.gz" + } + + def findAsset = releaseAssets =~/.*jdk_${arch}_[^"]*${filetype}".*/ + if (findAsset) { + assetExists = true + } + } + + if (assetExists) { + echo "${arch} JDK asset for version ${version} tag ${release} exists" + } else { + echo "${arch} JDK asset for version ${version} tag ${release} NOT FOUND" + } + return assetExists +} + node('worker') { def adopt_tag_search if (version == 8) { @@ -170,14 +217,22 @@ node('worker') { echo "Version "+versionStr+" already has a GA tag so not triggering a MAIN build" } - // Check binaries repo for existance of the given release? - echo "Checking if ${binariesRepoTag} is already published?" - def desiredRepoTagURL="${binariesRepo}/releases/tag/${binariesRepoTag}" - def httpCode=sh(script:"curl -s -o /dev/null -w '%{http_code}' "+desiredRepoTagURL, returnStdout:true) + // Check binaries repo for existance of the given release tag having being already built? + def jdkAssetToCheck = "x64_linux" + if (mirrorRepo.contains("aarch32-jdk8u")) { + // aarch32-jdk8u built in its own pipeline + jdkAssetToCheck = "arm_linux" + } else if (mirrorRepo.contains("alpine-jdk8u")) { + // alpine-jdk8u built in its own pipeline + jdkAssetToCheck = "x64_alpine-linux" + } + + echo "Checking if ${binariesRepoTag} is already published for JDK asset ${jdkAssetToCheck} ?" + def assetExists = checkJDKAssetExistsForArch(versionStr, binariesRepoTag, variant, jdkAssetToCheck) - if (httpCode == "200") { + if (assetExists) { echo "Build tag ${binariesRepoTag} is already published - nothing to do" - } else if (httpCode == "404") { + } else { echo "New unpublished build tag ${binariesRepoTag} - triggering builds" if (gaTagCheck == 0) { echo "Version "+versionStr+" already has a GA tag so not triggering a MAIN build" @@ -185,10 +240,6 @@ node('worker') { triggerMainBuild = true } triggerEvaluationBuild = true - } else { - def error = "Unexpected HTTP code ${httpCode} when querying for existing build tag at $desiredRepoTagURL" - echo "${error}" - throw new Exception("${error}") } } else { echo "FORCE triggering specified builds.." @@ -224,6 +275,11 @@ node('worker') { } } // End: node('worker') +echo "STATUS: triggerMainBuild: ${triggerMainBuild}" +echo "STATUS: triggerEvaluationBuild: ${triggerEvaluationBuild}" +triggerMainBuild=false +triggerEvaluationBuild=false + if (triggerMainBuild || triggerEvaluationBuild) { // Set version suffix, jdk8 has different mechanism to jdk11+ def additionalConfigureArgs = (version > 8) ? "--with-version-opt=ea" : "" From 7d8526fc6c58f075f1857b0a77c01958abfb788d Mon Sep 17 00:00:00 2001 From: Andrew Leonard Date: Mon, 2 Dec 2024 10:27:24 +0000 Subject: [PATCH 02/10] Make trigger_beta job check specific jdk8u aarch32 and alpine assests exist Signed-off-by: Andrew Leonard --- pipelines/build/common/trigger_beta_build.groovy | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pipelines/build/common/trigger_beta_build.groovy b/pipelines/build/common/trigger_beta_build.groovy index 119cd9364..aac9d5f71 100644 --- a/pipelines/build/common/trigger_beta_build.groovy +++ b/pipelines/build/common/trigger_beta_build.groovy @@ -115,10 +115,10 @@ def loadTargetConfigurations(String javaVersion, String variant, String configSe } // Verify the given published release tag contains the given asset architecture -def checkJDKAssetExistsForArch(String version, String release, String variant, String arch) { +def checkJDKAssetExistsForArch(String binariesRepo, String version, String releaseTag, String variant, String arch) { def assetExists = false - echo "Verifying ${version} assets in release: ${release}" + echo "Verifying ${version} JDK asset for ${arch} in release: ${releaseTag}" def publishVersion = version // aarch32-jdk8u and alpine-jdk8u published as "jdk8u" tags @@ -126,7 +126,7 @@ def checkJDKAssetExistsForArch(String version, String release, String variant, S publishVersion = "jdk8u" } - def escRelease = release.replaceAll("\\+", "%2B") + def escRelease = releaseTag.replaceAll("\\+", "%2B") def releaseAssetsUrl = "${binariesRepo}/releases/tags/${escRelease}".replaceAll("_NN_", publishVersion.replaceAll("[a-z]","")) // Get list of assets, concatenate into a single string @@ -228,7 +228,7 @@ node('worker') { } echo "Checking if ${binariesRepoTag} is already published for JDK asset ${jdkAssetToCheck} ?" - def assetExists = checkJDKAssetExistsForArch(versionStr, binariesRepoTag, variant, jdkAssetToCheck) + def assetExists = checkJDKAssetExistsForArch(binariesRepo, versionStr, binariesRepoTag, variant, jdkAssetToCheck) if (assetExists) { echo "Build tag ${binariesRepoTag} is already published - nothing to do" From 804374a312ef0921ebb3db8dbfd38fdfa3927add Mon Sep 17 00:00:00 2001 From: Andrew Leonard Date: Mon, 2 Dec 2024 10:38:00 +0000 Subject: [PATCH 03/10] Make trigger_beta job check specific jdk8u aarch32 and alpine assests exist Signed-off-by: Andrew Leonard --- pipelines/build/common/trigger_beta_build.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pipelines/build/common/trigger_beta_build.groovy b/pipelines/build/common/trigger_beta_build.groovy index aac9d5f71..29c19faca 100644 --- a/pipelines/build/common/trigger_beta_build.groovy +++ b/pipelines/build/common/trigger_beta_build.groovy @@ -127,7 +127,7 @@ def checkJDKAssetExistsForArch(String binariesRepo, String version, String relea } def escRelease = releaseTag.replaceAll("\\+", "%2B") - def releaseAssetsUrl = "${binariesRepo}/releases/tags/${escRelease}".replaceAll("_NN_", publishVersion.replaceAll("[a-z]","")) + def releaseAssetsUrl = binariesRepo.replaceAll("github.com","api.github.com/repos") + "/releases/tags/${escRelease}" // Get list of assets, concatenate into a single string def rc = sh(script: 'rm -f releaseAssets.json && curl -L -o releaseAssets.json '+releaseAssetsUrl, returnStatus: true) From 9f62bcb379998e81a80107dbfb22e6f1292e9c32 Mon Sep 17 00:00:00 2001 From: Andrew Leonard Date: Mon, 2 Dec 2024 10:40:04 +0000 Subject: [PATCH 04/10] Make trigger_beta job check specific jdk8u aarch32 and alpine assests exist Signed-off-by: Andrew Leonard --- pipelines/build/common/trigger_beta_build.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pipelines/build/common/trigger_beta_build.groovy b/pipelines/build/common/trigger_beta_build.groovy index 29c19faca..ee6911795 100644 --- a/pipelines/build/common/trigger_beta_build.groovy +++ b/pipelines/build/common/trigger_beta_build.groovy @@ -141,7 +141,7 @@ def checkJDKAssetExistsForArch(String binariesRepo, String version, String relea } else { // Work out the JDK artifact filetype def filetype - if (osarch.contains("Windows")) { + if (arch.contains("windows")) { filetype = "\\.zip" } else { filetype = "\\.tar\\.gz" From d3e62c0391afcbce07d2df1c898b626cbf59a239 Mon Sep 17 00:00:00 2001 From: Andrew Leonard Date: Mon, 2 Dec 2024 10:41:02 +0000 Subject: [PATCH 05/10] Make trigger_beta job check specific jdk8u aarch32 and alpine assests exist Signed-off-by: Andrew Leonard --- pipelines/build/common/trigger_beta_build.groovy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pipelines/build/common/trigger_beta_build.groovy b/pipelines/build/common/trigger_beta_build.groovy index ee6911795..15643560c 100644 --- a/pipelines/build/common/trigger_beta_build.groovy +++ b/pipelines/build/common/trigger_beta_build.groovy @@ -154,9 +154,9 @@ def checkJDKAssetExistsForArch(String binariesRepo, String version, String relea } if (assetExists) { - echo "${arch} JDK asset for version ${version} tag ${release} exists" + echo "${arch} JDK asset for version ${version} tag ${releaseTag} exists" } else { - echo "${arch} JDK asset for version ${version} tag ${release} NOT FOUND" + echo "${arch} JDK asset for version ${version} tag ${releaseTag} NOT FOUND" } return assetExists } From 781a4c5721d88ed4bcce8cbdaf798a59ba99be85 Mon Sep 17 00:00:00 2001 From: Andrew Leonard Date: Mon, 2 Dec 2024 10:46:15 +0000 Subject: [PATCH 06/10] Make trigger_beta job check specific jdk8u aarch32 and alpine assests exist Signed-off-by: Andrew Leonard --- pipelines/build/common/trigger_beta_build.groovy | 5 ----- 1 file changed, 5 deletions(-) diff --git a/pipelines/build/common/trigger_beta_build.groovy b/pipelines/build/common/trigger_beta_build.groovy index 15643560c..b6b75c69c 100644 --- a/pipelines/build/common/trigger_beta_build.groovy +++ b/pipelines/build/common/trigger_beta_build.groovy @@ -275,11 +275,6 @@ node('worker') { } } // End: node('worker') -echo "STATUS: triggerMainBuild: ${triggerMainBuild}" -echo "STATUS: triggerEvaluationBuild: ${triggerEvaluationBuild}" -triggerMainBuild=false -triggerEvaluationBuild=false - if (triggerMainBuild || triggerEvaluationBuild) { // Set version suffix, jdk8 has different mechanism to jdk11+ def additionalConfigureArgs = (version > 8) ? "--with-version-opt=ea" : "" From d9f5f77cac3a5a0d793dc420f0fbff91a805eb4a Mon Sep 17 00:00:00 2001 From: Andrew Leonard Date: Mon, 2 Dec 2024 10:57:54 +0000 Subject: [PATCH 07/10] Make trigger_beta job check specific jdk8u aarch32 and alpine assests exist Signed-off-by: Andrew Leonard --- pipelines/build/common/trigger_beta_build.groovy | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pipelines/build/common/trigger_beta_build.groovy b/pipelines/build/common/trigger_beta_build.groovy index b6b75c69c..7ef903a97 100644 --- a/pipelines/build/common/trigger_beta_build.groovy +++ b/pipelines/build/common/trigger_beta_build.groovy @@ -283,12 +283,14 @@ if (triggerMainBuild || triggerEvaluationBuild) { def jobs = [:] def pipelines = [:] - if (triggerMainBuild) { + // Trigger Main pipeline as long as we have a target configuration + if (triggerMainBuild && mainTargetConfigurations != "{}") { pipelines["main"] = "build-scripts/openjdk${version}-pipeline" echo "main build targetConfigurations:" echo JsonOutput.prettyPrint(mainTargetConfigurations) } - if (triggerEvaluationBuild) { + // Trigger Evaluation as long as we have a target configuration + if (triggerEvaluationBuild && evaluationTargetConfigurations != "{}") { pipelines["evaluation"] = "build-scripts/evaluation-openjdk${version}-pipeline" echo "evaluation build targetConfigurations:" echo JsonOutput.prettyPrint(evaluationTargetConfigurations) From a3a50a2c0dce377a0d2a0f38c6ce4d24cbeec723 Mon Sep 17 00:00:00 2001 From: Andrew Leonard Date: Mon, 2 Dec 2024 11:12:48 +0000 Subject: [PATCH 08/10] Make trigger_beta job check specific jdk8u aarch32 and alpine assests exist Signed-off-by: Andrew Leonard --- pipelines/build/common/trigger_beta_build.groovy | 6 ------ 1 file changed, 6 deletions(-) diff --git a/pipelines/build/common/trigger_beta_build.groovy b/pipelines/build/common/trigger_beta_build.groovy index 7ef903a97..8afd796e1 100644 --- a/pipelines/build/common/trigger_beta_build.groovy +++ b/pipelines/build/common/trigger_beta_build.groovy @@ -120,12 +120,6 @@ def checkJDKAssetExistsForArch(String binariesRepo, String version, String relea echo "Verifying ${version} JDK asset for ${arch} in release: ${releaseTag}" - def publishVersion = version - // aarch32-jdk8u and alpine-jdk8u published as "jdk8u" tags - if (version == "aarch32-jdk8u" || version == "alpine-jdk8u") { - publishVersion = "jdk8u" - } - def escRelease = releaseTag.replaceAll("\\+", "%2B") def releaseAssetsUrl = binariesRepo.replaceAll("github.com","api.github.com/repos") + "/releases/tags/${escRelease}" From 44e9f0126d77ea0a59e1187ee02f1bfc33072baa Mon Sep 17 00:00:00 2001 From: Andrew Leonard Date: Mon, 2 Dec 2024 11:30:38 +0000 Subject: [PATCH 09/10] Make trigger_beta job check specific jdk8u aarch32 and alpine assests exist Signed-off-by: Andrew Leonard --- pipelines/build/common/trigger_beta_build.groovy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pipelines/build/common/trigger_beta_build.groovy b/pipelines/build/common/trigger_beta_build.groovy index 8afd796e1..0eb7d869a 100644 --- a/pipelines/build/common/trigger_beta_build.groovy +++ b/pipelines/build/common/trigger_beta_build.groovy @@ -277,13 +277,13 @@ if (triggerMainBuild || triggerEvaluationBuild) { def jobs = [:] def pipelines = [:] - // Trigger Main pipeline as long as we have a target configuration + // Trigger Main pipeline as long as we have a non-empty target configuration if (triggerMainBuild && mainTargetConfigurations != "{}") { pipelines["main"] = "build-scripts/openjdk${version}-pipeline" echo "main build targetConfigurations:" echo JsonOutput.prettyPrint(mainTargetConfigurations) } - // Trigger Evaluation as long as we have a target configuration + // Trigger Evaluation as long as we have a non-empty target configuration if (triggerEvaluationBuild && evaluationTargetConfigurations != "{}") { pipelines["evaluation"] = "build-scripts/evaluation-openjdk${version}-pipeline" echo "evaluation build targetConfigurations:" From c4b0c19236b5ecd7a1c2be2c5844cf5937cf4993 Mon Sep 17 00:00:00 2001 From: Andrew Leonard Date: Mon, 2 Dec 2024 13:32:10 +0000 Subject: [PATCH 10/10] Make trigger_beta job check specific jdk8u aarch32 and alpine assests exist Signed-off-by: Andrew Leonard --- pipelines/build/common/trigger_beta_build.groovy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pipelines/build/common/trigger_beta_build.groovy b/pipelines/build/common/trigger_beta_build.groovy index 0eb7d869a..124c79677 100644 --- a/pipelines/build/common/trigger_beta_build.groovy +++ b/pipelines/build/common/trigger_beta_build.groovy @@ -115,7 +115,7 @@ def loadTargetConfigurations(String javaVersion, String variant, String configSe } // Verify the given published release tag contains the given asset architecture -def checkJDKAssetExistsForArch(String binariesRepo, String version, String releaseTag, String variant, String arch) { +def checkJDKAssetExistsForArch(String binariesRepo, String version, String releaseTag, String arch) { def assetExists = false echo "Verifying ${version} JDK asset for ${arch} in release: ${releaseTag}" @@ -222,7 +222,7 @@ node('worker') { } echo "Checking if ${binariesRepoTag} is already published for JDK asset ${jdkAssetToCheck} ?" - def assetExists = checkJDKAssetExistsForArch(binariesRepo, versionStr, binariesRepoTag, variant, jdkAssetToCheck) + def assetExists = checkJDKAssetExistsForArch(binariesRepo, versionStr, binariesRepoTag, jdkAssetToCheck) if (assetExists) { echo "Build tag ${binariesRepoTag} is already published - nothing to do"