Skip to content

Commit

Permalink
fix closure
Browse files Browse the repository at this point in the history
  • Loading branch information
jstastny-cz committed Nov 8, 2023
1 parent 554454e commit c1d78bc
Showing 1 changed file with 19 additions and 16 deletions.
35 changes: 19 additions & 16 deletions .ci/jenkins/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,25 @@ pipeline {
}
stages {
stage("Build&Test") {
List buildParams = []
buildParams.add(string(name: "DISPLAY_NAME", value: "PR #${CHANGE_ID} - ${image}: ${CHANGE_URL}"))
buildParams.add(string(name: "CHANGE_ID", value: CHANGE_ID))
buildParams.add(string(name: "CHANGE_URL", value: CHANGE_URL))
buildParams.add(string(name: 'SOURCE_AUTHOR', value: getChangeAuthor()))
buildParams.add(string(name: 'SOURCE_BRANCH', value: getChangeBranch()))
buildParams.add(string(name: 'TARGET_BRANCH', value: getChangeTarget()))
buildParams.add(string(name: 'BUILD_KOGITO_APPS_REF', value: getChangeTarget()))

// Keep executing so we can cancel all if needed
def job = build(job: "${getRepoName()}.build-and-test", wait: true, parameters: buildParams, propagate: false)
if (job.result != 'SUCCESS') {
if (job.result == 'UNSTABLE') {
unstable("Tests on images seems to have failed: ${job.absoluteUrl}")
} else {
error("Error building images. Please check the logs of the job: ${job.absoluteUrl}")
steps {
script {
List buildParams = []
buildParams.add(string(name: "DISPLAY_NAME", value: "PR #${CHANGE_ID}: ${CHANGE_URL}"))
buildParams.add(string(name: "CHANGE_ID", value: CHANGE_ID))
buildParams.add(string(name: "CHANGE_URL", value: CHANGE_URL))
buildParams.add(string(name: 'SOURCE_AUTHOR', value: getChangeAuthor()))
buildParams.add(string(name: 'SOURCE_BRANCH', value: getChangeBranch()))
buildParams.add(string(name: 'TARGET_BRANCH', value: getChangeTarget()))
buildParams.add(string(name: 'BUILD_KOGITO_APPS_REF', value: getChangeTarget()))
// Keep executing so we can cancel all if needed
def job = build(job: "${getRepoName()}.build-and-test", wait: true, parameters: buildParams, propagate: false)
if (job.result != 'SUCCESS') {
if (job.result == 'UNSTABLE') {
unstable("Tests on images seems to have failed: ${job.absoluteUrl}")
} else {
error("Error building images. Please check the logs of the job: ${job.absoluteUrl}")
}
}
}
}
}
Expand Down

0 comments on commit c1d78bc

Please sign in to comment.