From df90ab2fdfb103987affe26256784d1ef4c43157 Mon Sep 17 00:00:00 2001 From: Andrew Leonard Date: Wed, 11 Dec 2024 12:14:17 +0000 Subject: [PATCH] Prevent build_job_generator regeneration from blowing up if no targetConfigurations Signed-off-by: Andrew Leonard --- pipelines/build/regeneration/build_job_generator.groovy | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pipelines/build/regeneration/build_job_generator.groovy b/pipelines/build/regeneration/build_job_generator.groovy index 4a6962c0c..f58387705 100644 --- a/pipelines/build/regeneration/build_job_generator.groovy +++ b/pipelines/build/regeneration/build_job_generator.groovy @@ -211,7 +211,10 @@ node('worker') { checkoutUserPipelines() } - if (jenkinsCreds != '') { + if (targetConfigurations.size() == 0) { + println "[WARNING] No targetConfigurations to be generated for this version" + } else { + if (jenkinsCreds != '') { withCredentials([usernamePassword( credentialsId: "${JENKINS_AUTH}", usernameVariable: 'jenkinsUsername', @@ -240,7 +243,7 @@ node('worker') { jobType ).regenerate() } - } else { + } else { println '[WARNING] No Jenkins API Credentials have been provided! If your server does not have anonymous read enabled, you may encounter 403 api request error code.' regenerationScript( javaVersion, @@ -263,6 +266,7 @@ node('worker') { checkoutCreds, jobType ).regenerate() + } } println '[SUCCESS] All done!' } finally {