Skip to content

Commit

Permalink
Pass in parameter COMPARED_JOB_NAME instead of setting default value
Browse files Browse the repository at this point in the history
The default value will be reset when parameterized jenkins pipeline
executes

Signed-off-by: Sophia Guo <sophia.gwf@gmail.com>
  • Loading branch information
sophia-guo committed Aug 16, 2023
1 parent 41a2467 commit 91ae926
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pipelines/build/common/openjdk_build_pipeline.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,6 @@ class Build {
def JobHelper = context.library(identifier: "openjdk-jenkins-helper@${helperRef}").JobHelper
if (!JobHelper.jobIsRunnable(comparedJobName as String)) {
def jobParams = [:]
jobParams.put("COMPARED_JOB_NAME", "${env.JOB_NAME}")
context.node('worker') {
context.println "Reproduce_compare job doesn't exist, create reproduce_compare job: ${comparedJobName}"
context.jobDsl scriptText: """
Expand All @@ -608,7 +607,7 @@ class Build {
definition {
parameters {
stringParam("COMPARED_JOB_NUMBER", "", "Compared nightly build job number.")
stringParam("COMPARED_JOB_NAME", COMPARED_JOB_NAME, "Compared nightly build job name")
stringParam("COMPARED_JOB_NAME", "", "Compared nightly build job name")
stringParam("COMPARED_AGENT", "", "Compared nightly build job agent.")
stringParam("COMPARED_JOB_PARAMS", "", "Compared nightly build job parameters")
}
Expand All @@ -632,7 +631,7 @@ class Build {
}
}
}
""" , ignoreExisting: false, additionalParameters: jobParams
""" , ignoreExisting: false
}
}
context.stage('Reproduce Compare') {
Expand All @@ -642,6 +641,7 @@ class Build {
propagate: false,
parameters: [
context.string(name: 'COMPARED_JOB_NUMBER', value: "${env.BUILD_NUMBER}"),
context.string(name: 'COMPARED_JOB_NAME', value: "${env.JOB_NAME}"),
context.string(name: 'COMPARED_AGENT', value: nonDockerNodeName),
context.string(name: 'COMPARED_JOB_PARAMS', value: buildParams)
],
Expand Down

0 comments on commit 91ae926

Please sign in to comment.