Plugin Information
This plugin from Tikal Knowledge allows sending Job Status notifications in JSON and XML formats. Job Notifications are defined in job's configuration, in their own separate section "Job Notifications":
Several notification endpoints can be defined. Each endpoint can be configured with:
Example of notification message (you can use requestb.in and jsonlint.com services to aggregate HTTP requests and validate JSON payload): {
"name": "asgard",
"url": "job/asgard/",
"build": {
"full_url": "http://localhost:8080/job/asgard/18/",
"number": 18,
"phase": "COMPLETED",
"status": "SUCCESS",
"url": "job/asgard/18/",
"scm": {
"url": "https://github.com/evgeny-goldin/asgard.git",
"branch": "origin/master",
"commit": "c6d86dc654b12425e706bcf951adfe5a8627a517"
},
"artifacts": {
"asgard.war": {
"archive": "http://localhost:8080/job/asgard/18/artifact/asgard.war"
},
"asgard-standalone.jar": {
"archive": "http://localhost:8080/job/asgard/18/artifact/asgard-standalone.jar",
"s3": "https://s3-eu-west-1.amazonaws.com/evgenyg-bakery/asgard/asgard-standalone.jar"
}
}
}
}
The payload submitted includes the following information:
AWS S3 SupportIf Jenkins S3 Plugin is installed and artifacts are uploaded to AWS S3 by "Publish artifacts to S3 Bucket" post-build action - the plugin will send their downloadable locations as well. Note that you need to edit S3 bucket's policy (see example) to make its artifacts directly "downloadable" by anonymous users. Here's one possible policy: {
"Version": "2008-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"AWS": "*"
},
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::notification-plugin/*"
}
]
}
|
Notification Plugin
Skip to end of metadata
Go to start of metadata


Comments (9)
Jun 21, 2012
Jonathan Edwards says:
It would be extremely useful if the plugin you read the hostname:port or http://...It would be extremely useful if the plugin you read the hostname:port or http:// URL from a build parameter (i.e. environment variable), as this would allow a remote job initiator to specify the postback URL/host:port dynamically. Would this be a difficult modification?
Sep 10, 2012
Lars Bilke says:
I would really love to be able to append some custom data to the notification da...I would really love to be able to append some custom data to the notification data. Maybe this could achieved with an optional text field in which I could type some custom data in json-format, the result could be:
{"name":"JobName", ... "custom_data":{"foo":1, "bar":"1234" } }What do you think?
Jun 19
Evgeny Goldin says:
Lars, please have a look at "jenkins-notify-plugin" - it allows to prov...Lars, please have a look at "jenkins-notify-plugin" - it allows to provide a configurable Groovy template as a JSON payload. This plugin wasn't officially released as most of its functionality was merged with Notification Plugin. Still, it can be useful in some cases.
Sep 17, 2012
Dan Spiteri says:
For HTTP, could you possible make it send as POST? I tried a php script at the o...For HTTP, could you possible make it send as POST? I tried a php script at the other end of the notification, and i cant seem to work out how to recieve the data.
Jan 02, 2014
Axel H says:
This is already sending the data via POST. To read this information in a PHP-Scr...This is already sending the data via POST.
To read this information in a PHP-Script, you need to read it from 'php://input'
$body = file_get_contents('php://input'); $object = json_decode($body); // ...Dec 20, 2012
Brian Johnson says:
Made a mod for this to work with sevabot... YMMV -- https://github.com/...Made a mod for this to work with sevabot... YMMV -- https://github.com/opensourcehacker/sevabot/pull/14
Sep 27, 2013
Juri Strumpflohner says:
Note that the above sample JSON is not valid. It is missing a comma after the fu...Note that the above sample JSON is not valid. It is missing a comma after the fullurl "full_url":"http://ci.jenkins.org/job/project/5",
Jun 19
Evgeny Goldin says:
Thanks! I just updated a JSON sample.Thanks! I just updated a JSON sample.
Sep 17
Hrusikesh Panda says:
I just installed the latest version and I don't see Event or Timeout dropdown. A...I just installed the latest version and I don't see Event or Timeout dropdown. Also, it is not sending artifacts in the payload even though I have "Archive the artifacts" and Jenkins URL configured. Any ideas?
Add Comment