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}'""" + } + } + } +}