From c392bdab7850dda0a266fdc6a597eedb586ea066 Mon Sep 17 00:00:00 2001 From: Andrew Leonard Date: Fri, 11 Aug 2023 10:57:01 +0100 Subject: [PATCH] Ensure target is reset before loading a jdk pipeline config file Signed-off-by: Andrew Leonard --- .../build/regeneration/build_pipeline_generator.groovy | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pipelines/build/regeneration/build_pipeline_generator.groovy b/pipelines/build/regeneration/build_pipeline_generator.groovy index d8b650237..b0441c459 100644 --- a/pipelines/build/regeneration/build_pipeline_generator.groovy +++ b/pipelines/build/regeneration/build_pipeline_generator.groovy @@ -198,11 +198,11 @@ node('worker') { config.put('targetConfigurations', target.targetConfigurations) // Set disableJob if in target - if (target.hasProperty('target.disableJob')) { + if (target.metaClass.hasProperty(target, 'disableJob')) { config.put('disableJob', target.disableJob) } - if (enablePipelineSchedule.toBoolean() && target.hasProperty('triggerSchedule_nightly')) { + if (enablePipelineSchedule.toBoolean() && target.metaClass.hasProperty(target, 'triggerSchedule_nightly')) { config.put('pipelineSchedule', target.triggerSchedule_nightly) } @@ -249,7 +249,7 @@ node('worker') { // Load weeklyTemplatePath. This is where the weekly_release_pipeline_job_template.groovy code is located compared to the repository root. This actually sets up the weekly pipeline job using the parameters above. def weeklyTemplatePath = (params.WEEKLY_TEMPLATE_PATH) ?: DEFAULTS_JSON['templateDirectories']['weekly'] - if (enablePipelineSchedule.toBoolean() && target.hasProperty('triggerSchedule_weekly')) { + if (enablePipelineSchedule.toBoolean() && target.metaClass.hasProperty(target, 'triggerSchedule_weekly')) { config.put('pipelineSchedule', target.triggerSchedule_weekly) } config.releaseType = "Weekly"