Skip to content

Commit

Permalink
GitHub message error paths (NOAA-EMC#2401)
Browse files Browse the repository at this point in the history
Add feature to message paths to error logs of failed experiments to
GitHub Messaging the PR from Jenkins.
  • Loading branch information
TerrenceMcGuinness-NOAA committed Mar 15, 2024
1 parent d897ee4 commit 056cfdc
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ci/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,12 @@ pipeline {
sh(script: "${HOMEgfs}/ci/scripts/utils/ci_utils_wrapper.sh cancel_all_batch_jobs ${HOME}/RUNTESTS")
ws(HOME) {
if (fileExists('RUNTESTS/error.logs')) {
def error_logs = sh(script: "cat RUNTESTS/error.logs", returnStdout: true).trim()
try {
pullRequest.comment("Experiment ${Case} failed on ${Machine}\n\nError logs:\n\n${error_logs}")
} catch (Exception error) {
echo "Failed to comment on PR: ${error.getMessage()}"
}
def fileContent = readFile 'RUNTESTS/error.logs'
def lines = fileContent.readLines()
for (line in lines) {
Expand Down

0 comments on commit 056cfdc

Please sign in to comment.