Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure target is reset before loading a jdk pipeline config file #774

Merged
merged 12 commits into from
Aug 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 19 additions & 6 deletions pipelines/build/regeneration/build_pipeline_generator.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,8 @@ node('worker') {
checkoutUserPipelines()
}
}
println "[INFO] JDK${javaVersion}: loaded target configuration:"
println JsonOutput.prettyPrint(JsonOutput.toJson(target))

config.put('targetConfigurations', target.targetConfigurations)

Expand All @@ -203,7 +205,11 @@ node('worker') {
}

if (enablePipelineSchedule.toBoolean()) {
config.put('pipelineSchedule', target.triggerSchedule_nightly)
try {
config.put('pipelineSchedule', target.triggerSchedule_nightly)
} catch (Exception ex) {
config.put('pipelineSchedule', '0 0 31 2 0')
}
}

if (useAdoptShellScripts.toBoolean()) {
Expand Down Expand Up @@ -231,8 +237,6 @@ node('worker') {
checkoutUserPipelines()
}

target.disableJob = false

generatedPipelines.add(config['JOB_NAME'])

// Create weekly release pipeline
Expand All @@ -252,7 +256,11 @@ node('worker') {
def weeklyTemplatePath = (params.WEEKLY_TEMPLATE_PATH) ?: DEFAULTS_JSON['templateDirectories']['weekly']

if (enablePipelineSchedule.toBoolean()) {
config.put('pipelineSchedule', target.triggerSchedule_weekly)
try {
config.put('pipelineSchedule', target.triggerSchedule_weekly)
} catch (Exception ex) {
config.put('pipelineSchedule', '0 0 31 2 0')
}
}
config.releaseType = "Weekly"

Expand All @@ -272,9 +280,14 @@ node('worker') {
checkoutUserPipelines()
}

target.disableJob = false

generatedPipelines.add(config['JOB_NAME'])

// config.load() loads into the current groovy binding, and returns "this", so we need to reset variables before next load of target
target.targetConfigurations = {}
target.triggerSchedule_nightly = '0 0 31 2 0'
target.triggerSchedule_weekly = '0 0 31 2 0'
target.weekly_release_scmReferences = {}
target.disableJob = false
})

// Fail if nothing was generated
Expand Down