Add XMPP notification post-build step
This commit is contained in:
20
Jenkinsfile
vendored
20
Jenkinsfile
vendored
@@ -9,4 +9,24 @@ pipeline {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
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}'"""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user