Skip to content

Latest commit

 

History

History
39 lines (26 loc) · 2.05 KB

README.md

File metadata and controls

39 lines (26 loc) · 2.05 KB

jenkins-notify-plugin

Jenkins plugin sending POST request as a post-build action with configurable JSON payload.

By default payload submitted contains the details of the build (build number, build result, job and log URLs), URLs of artifacts generated, Git branch and commit SHA.

But being a configurable Groovy template it can contain any Jenkins, job or build details you may think of!

Post-build action with JSON payload submitted as POST request

JSON payload is rendered as a Groovy template, having the following variables in scope:

Here's a RequestBin of submitting a default payload:

RequestBin for the default JSON payload

In addition, json( Object ) helper function is available, rendering any Object provided as JSON.

For example:

{
  "items":       ${ json( jenkins.allItems ) },
  "computers":   ${ json( jenkins.computers.collect{ it.displayName }) },
  "moduleRoots": ${ json( build.moduleRoots )},
  "artifacts":   ${ json( build.artifacts )},
  "env":         ${ json( env ) },
  "properties":  ${ json( [ system: System.properties.keySet(), env: env.keySet() ]) }
}

Building and installing the plugin

mvn clean package -s settings.xml
cp -f target/*.hpi ~/.jenkins/plugins