Skip to content

Commit

Permalink
Ensure target is reset before loading a jdk pipeline config file (#774)
Browse files Browse the repository at this point in the history
* Ensure target is reset before loading a jdk pipeline config file

Signed-off-by: Andrew Leonard <[email protected]>

* Ensure target is reset before loading a jdk pipeline config file

Signed-off-by: Andrew Leonard <[email protected]>

* Ensure target is reset before loading a jdk pipeline config file

Signed-off-by: Andrew Leonard <[email protected]>

* Ensure target is reset before loading a jdk pipeline config file

Signed-off-by: Andrew Leonard <[email protected]>

* Ensure target is reset before loading a jdk pipeline config file

Signed-off-by: Andrew Leonard <[email protected]>

* Ensure target is reset before loading a jdk pipeline config file

Signed-off-by: Andrew Leonard <[email protected]>

* Ensure target is reset before loading a jdk pipeline config file

Signed-off-by: Andrew Leonard <[email protected]>

* Ensure target is reset before loading a jdk pipeline config file

Signed-off-by: Andrew Leonard <[email protected]>

* Ensure target is reset before loading a jdk pipeline config file

Signed-off-by: Andrew Leonard <[email protected]>

* Ensure target is reset before loading a jdk pipeline config file

Signed-off-by: Andrew Leonard <[email protected]>

* Ensure target is reset before loading a jdk pipeline config file

Signed-off-by: Andrew Leonard <[email protected]>

* Ensure target is reset before loading a jdk pipeline config file

Signed-off-by: Andrew Leonard <[email protected]>

---------

Signed-off-by: Andrew Leonard <[email protected]>
  • Loading branch information
andrew-m-leonard authored Aug 11, 2023
1 parent 81f70e4 commit cedc501
Showing 1 changed file with 19 additions and 6 deletions.
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

0 comments on commit cedc501

Please sign in to comment.