diff --git a/pipelines/build/regeneration/build_pipeline_generator.groovy b/pipelines/build/regeneration/build_pipeline_generator.groovy index 2e07cab1f..113db0a48 100644 --- a/pipelines/build/regeneration/build_pipeline_generator.groovy +++ b/pipelines/build/regeneration/build_pipeline_generator.groovy @@ -201,12 +201,8 @@ node('worker') { config.put('disableJob', target.disableJob) } - if (enablePipelineSchedule.toBoolean()) { - try { - config.put('pipelineSchedule', target.triggerSchedule_nightly) - } catch (Exception ex) { - config.put('pipelineSchedule', '0 0 31 2 0') // 31st Feb, so will never run - } + if (enablePipelineSchedule.toBoolean() && target.hasProperty('triggerSchedule_nightly')) { + config.put('pipelineSchedule', target.triggerSchedule_nightly) } if (useAdoptShellScripts.toBoolean()) { @@ -252,12 +248,8 @@ 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()) { - try { - config.put('pipelineSchedule', target.triggerSchedule_weekly) - } catch (Exception ex) { - config.put('pipelineSchedule', '0 0 31 2 0') // 31st Feb, so will never run - } + if (enablePipelineSchedule.toBoolean() && target.hasProperty('triggerSchedule_weekly')) { + config.put('pipelineSchedule', target.triggerSchedule_weekly) } config.releaseType = "Weekly"