From 6122c48377b037b4a063c4d33733752993a042be Mon Sep 17 00:00:00 2001 From: admin Date: Sat, 28 Feb 2026 21:43:42 +0000 Subject: [PATCH] Add XMPP notification post-build step --- Jenkinsfile | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 62aa41c..61d66ae 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -9,4 +9,24 @@ pipeline { } } } -} \ No newline at end of file + post { + always { + script { + def status = currentBuild.currentResult + def payload = groovy.json.JsonOutput.toJson([ + name: env.JOB_NAME, + build: [ + number: env.BUILD_NUMBER as int, + status: status, + phase: "COMPLETED", + duration: currentBuild.duration, + full_url: env.BUILD_URL + ] + ]) + sh """curl -s -X POST http://127.0.0.1:9090/jenkins \ + -H 'Content-Type: application/json' \ + -d '${payload}'""" + } + } + } +}