Skip to content

Commit

Permalink
test: add try/catch in case of error
Browse files Browse the repository at this point in the history
  • Loading branch information
valentinab25 authored Jun 25, 2024
1 parent c218528 commit 6d103d8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,12 @@ pipeline {
post {
failure {
script {
sh """if [ -f ${FRONTEND_NAME}/checkresult.txt ] ; then cat ${FRONTEND_NAME}/checkresult.txt | grep -v 'https://service.bundlewatch.io/results' > result.txt; fi"""
try {
sh """cat ${FRONTEND_NAME}/checkresult.txt | grep -v 'https://service.bundlewatch.io/results' > result.txt"""
}
catch {
sh """echo '\n\nPlease check Jenkins logs for detailed error message' >> result.txt"""
}
publishChecks name: "Bundlewatch on ${env.FRONTEND_NAME}", title: "Bunde size check on ${env.FRONTEND_NAME}", summary: "Result of bundlewatch run on ${env.FRONTEND_NAME}",
text: readFile(file: "result.txt"), conclusion: "${currentBuild.currentResult}",
detailsURL: "${env.BUILD_URL}display/redirect"
Expand Down

0 comments on commit 6d103d8

Please sign in to comment.