From ac4c18fb4efe640fca4d08780911daae216bc195 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Tamarelle?= Date: Thu, 24 May 2018 09:54:25 +0200 Subject: [PATCH] docs: Add a notif example for Google Hangouts Chat --- docs/notifications.md | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/docs/notifications.md b/docs/notifications.md index f8c2417c4..17588f79c 100644 --- a/docs/notifications.md +++ b/docs/notifications.md @@ -10,7 +10,7 @@ commands. ## Usage -An example with a **hipchat** hook: +An example with a **HipChat** and **Google Hangouts Chat** hook: #### Single notification @@ -26,23 +26,16 @@ notify: ```yaml notify: - 'example-package-1' + 'example-google-chat': + method: POST + headers: [{'Content-Type': 'application/json'}] + endpoint: https://chat.googleapis.com/v1/spaces/AAAAB_TcJYs/messages?key=myKey&token=myToken + content: '{"text":"New package published: `{{ name }}{{#each versions}} v{{version}}{{/each}}`"}' + 'example-hipchat': method: POST headers: [{'Content-Type': 'application/json'}] endpoint: https://usagge.hipchat.com/v2/room/3729485/notification?auth_token=mySecretToken content: '{"color":"green","message":"New package published: * {{ name }}*","notify":true,"message_format":"text"}' - 'example-package-2' - method: POST - headers: [{'Content-Type': 'application/json'}] - endpoint: https://usagge.hipchat.com/v2/room/3729485/notification?auth_token=mySecretToken - content: '{"color":"green","message":"New package published: * {{ name }}*","notify":true,"message_format":"text"}' - 'example-package-3' - method: POST - headers: [{'Content-Type': 'application/json'}] - endpoint: https://usagge.hipchat.com/v2/room/3729485/notification?auth_token=mySecretToken - content: '{"color":"green","message":"New package published: * {{ name }}*","notify":true,"message_format":"text"}' - - ``` ## Configuration @@ -54,5 +47,4 @@ packagePattern| string | No | all | | Only run this notification if the package packagePatternFlags| string | No | all | | Any flags to be used with the regular expression headers| array/object | Yes | all | | If this endpoint requires specific headers, set them here as an array of key: value objects. endpoint| string | Yes | all | | set the URL endpoint for this call -content| string | Yes | all | | any Handlebar expressions - +content| string | Yes | all | | any [handlebar](https://handlebarsjs.com/) expressions