Skip to content

Commit

Permalink
Prevent build_job_generator regeneration from blowing up if no target…
Browse files Browse the repository at this point in the history
…Configurations

Signed-off-by: Andrew Leonard <[email protected]>
  • Loading branch information
andrew-m-leonard committed Dec 11, 2024
1 parent c092e0e commit df90ab2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pipelines/build/regeneration/build_job_generator.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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,
Expand All @@ -263,6 +266,7 @@ node('worker') {
checkoutCreds,
jobType
).regenerate()
}
}
println '[SUCCESS] All done!'
} finally {
Expand Down

0 comments on commit df90ab2

Please sign in to comment.