Skip to content

rafaelreuber/google-chat-notification-plugin

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

89 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Google Chat plugin for Jenkins

Build Status Jenkins Plugin GitHub release Jenkins Plugin Installs

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.361.1 or higher.

Screenshot

Prerequisites

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', messageFormat: 'simple|card', sameThreadNotification: 'true', threadKey: '', notifyAborted: 'true', notifyFailure: 'true', notifyNotBuilt: 'true', notifySuccess: 'true', notifyUnstable: 'true', notifyBackToNormal: 'true', suppressInfoLoggers: '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. messageFormat

    • This is an optional String parameter.
    • The format of the message sent. Default value is simple.
    • If card is provided as value, the parameter message must be a valid JSON configuration for card message.
  4. 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. If false, the default behavior is to create a new thread for each message.
    • If messageFormat is set to card and the provided JSON contains a 'thread' key, this parameter will be ignored.
  5. threadKey

    • This is an optional String parameter. Default value is null.
    • The thread used to send all the generated notification messages for a particular job. If not defined, the default behavior is to use the JOB_NAME as threadKey.
    • Supports all token macro variables for pipeline as well as build jobs.
    • This parameter only applies if sameThreadNotification is set to true.
    • If messageFormat is set to card and the provided JSON contains a 'thread' key, this parameter will be ignored.
  6. notifyAborted

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

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

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

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

    • This is an optional boolean parameter. Default value is false.
    • Notification message to be sent when build status is UNSTABLE.
  11. 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.
  12. suppressInfoLoggers

    • This is an optional boolean parameter. Default value is false.
    • Suppress all info loggers in Jenkins build.

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

Report an Issue

Please report issues and enhancements through the Jenkins issue tracker.

About

Google Chat Notification Jenkins Plugin to send build status

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 93.8%
  • HTML 6.2%