From a6ede56076e6d396a597abd7b7452374db93dd07 Mon Sep 17 00:00:00 2001 From: seth-mg Date: Fri, 12 Jan 2024 15:17:04 -0600 Subject: [PATCH] Update CI.Jenkinsfile Post results to teams --- CI.Jenkinsfile | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CI.Jenkinsfile b/CI.Jenkinsfile index 875fd62..3eb4105 100644 --- a/CI.Jenkinsfile +++ b/CI.Jenkinsfile @@ -87,8 +87,18 @@ node ("docker-light") { } } } + postToTeams(true) } catch (e) { currentBuild.result = "FAILED" + postToTeams(false) throw e } } + +def postToTeams(boolean success) { + def webhookUrl = "${env.TEAMS_PNC_JENKINS_WEBHOOK_URL}" + def color = success ? "#00FF00" : "#FF0000" + def status = success ? "SUCCESSFUL" : "FAILED" + def message = "*" + status + ":* '${env.JOB_NAME}' - [${env.BUILD_NUMBER}] - ${env.BUILD_URL}" + office365ConnectorSend(webhookUrl: webhookUrl, color: color, message: message, status: status) +}