Skip to content

drwestt/google-chat-notification-plugin

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

google-chat-notification-jenkins-plugin

Google Chat Notification Jenkins Plugin to send build status to Google Chat

This Jenkins plugin allows you to send Google Chat notification as a post build action or as a pipeline script. This plugin is supported for Jenkins version 2.60.3 or higher.

Prerequisites

  • You must create a web hook in google chat group to send notification.

Screenshot

How to configure it in post build action

  • Click on Add post-build action button

Screenshot

  • Click on Google Chat Notification

Screenshot

  • Configure URL (web hook URL configured in prerequisites), message (build message) and type of build result you want to send notification. You can configure multiple URLs separated by comma.

Screenshot

How to use it in pipeline script

Use below command

googlechatnotification url: 'web hook(s) URL(s)', message: 'message to be sent', notifyAborted: 'true', notifyFailure: 'true', notifyNotBuilt: 'true', notifySuccess: 'true', notifyUnstable: 'true', notifyBackToNormal: 'true', suppressInfoLoggers: 'true', sameThreadNotification: 'true'

Please find explanations for each fields as below, usage for all fields remains same for build job and pipeline:

  1. url

  2. message

    • This is a mandatory String parameter.
    • Notification message to be sent.
    • Supports all token macro variables for pipeline as well as build jobs.
  3. Thread ID

    • This is an optionalString parameter.
    • Notification message to be sent in a specific thread in Google Chat GSuite.
  4. notifyAborted

    • This is an optional boolean parameter. Default value is false.
    • Notification message to be sent when build status is ABORTED.
  5. notifyFailure

    • This is an optional boolean parameter. Default value is false.
    • Notification message to be sent when build status is FAILURE.
  6. notifyNotBuilt

    • This is an optional boolean parameter. Default value is false.
    • Notification message to be sent when build status is NOT_BUILT.
  7. notifySuccess

    • This is an optional boolean parameter. Default value is false.
    • Notification message to be sent when build status is SUCCESS.
  8. notifyUnstable

    • This is an optional boolean parameter. Default value is false.
    • Notification message to be sent when build status is UNSTABLE.
  9. notifyBackToNormal

    • This is an optional boolean parameter. Default value is false.
    • Notification message to be sent when build status is SUCCESS and previous build status was not SUCCESS.
  10. suppressInfoLoggers

  • This is an optional boolean parameter. Default value is false.
  • Suppress all info loggers in Jenkins build.
  1. sameThreadNotification
  • This is an optional boolean parameter. Default value is false.
  • This parameter is used to send notification in same thread for a particular job. Here thread_key is a value of JOB_NAME.

Default behaviour of plugin is to send notifications for all build status unless overridden with true value for above defined build statuses.

About

Google Chat Notification Jenkins Plugin to send build status

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 96.6%
  • HTML 3.4%