Skip to content

Jenkins plugin to send a POST request to any URL when a build is successful, and include details of the build and artifacts generated

License

Notifications You must be signed in to change notification settings

cloudnative/jenkins-notify-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Jenkins plugin to send a POST request to any URL when a build is successful, and include details of the build and artifacts generated

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published