From adcd02a3567eca8a644098b6bf7591535db4cbb7 Mon Sep 17 00:00:00 2001 From: Bruno Goncalves Date: Nov 13 2020 09:52:05 +0000 Subject: irc notification contains link to test job directly --- diff --git a/Jenkinsfile-fedora-ci-monitor b/Jenkinsfile-fedora-ci-monitor index 63bc0af..bab8ac6 100644 --- a/Jenkinsfile-fedora-ci-monitor +++ b/Jenkinsfile-fedora-ci-monitor @@ -41,10 +41,17 @@ def SendIRC() { if (env.test_result == "PASS" || env.test_result == "SKIP") { return } - def msg = """${env.test_result} - ${env.buildname} - [${env.BUILD_NUMBER}]': Check console output at ${env.BUILD_URL}""" + def msg = "${env.test_result} - ${env.buildname}" + if (TEST_RESULT && TEST_RESULT['results'][0].containsKey('jenkins_build_url')) { + def test_url = TEST_RESULT['results'][0]['jenkins_build_url'] + msg += " - ${test_url}" + } + msg += "\nCheck console output at ${env.BUILD_URL}" ircNotify targets: "#fedora-ci", customMessage: msg } +TEST_RESULT = null + properties( [ buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '1000', daysToKeepStr: '', numToKeepStr: '1000')), @@ -119,7 +126,9 @@ pipeline{ env.return = "0" } currentBuild.displayName = "${env.test_result}: ${env.buildname}" - + if (fileExists("result.json")) { + TEST_RESULT = readJSON file: "result.json" + } sh("exit ${env.return}") } } @@ -129,7 +138,7 @@ pipeline{ always { SendEmail() SendIRC() - archiveArtifacts artifacts: 'test.log' + archiveArtifacts artifacts: 'test.log,result.json', allowEmptyArchive: true } } }