Skip to content

Commit

Permalink
Add try-catch block to catch error while triggering other jobs (#1353)
Browse files Browse the repository at this point in the history
Signed-off-by: Zelin Hao <[email protected]>
  • Loading branch information
zelinh authored Dec 16, 2021
1 parent ea5a964 commit 99dfb20
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions jenkins/check-for-build.jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,15 @@ pipeline {
if (sha.exists) {
echo "Skipping, ${sha.path} already exists."
} else {
build job: "${TARGET_JOB_NAME}", parameters: [
try {
build job: "${TARGET_JOB_NAME}", parameters: [
string(name: 'INPUT_MANIFEST', value: "${INPUT_MANIFEST}")
], wait: true
echo "Build succeeded, uploading build SHA for that job"
buildUploadManifestSHA(jobName: "${TARGET_JOB_NAME}")
], wait: true
echo "Build succeeded, uploading build SHA for that job"
buildUploadManifestSHA(jobName: "${TARGET_JOB_NAME}")
} catch (err) {
echo "${TARGET_JOB_NAME} failed"
}
}
}
}
Expand Down

0 comments on commit 99dfb20

Please sign in to comment.