2017-12-16 13:25:59 +01:00
|
|
|
---
|
|
|
|
id: notifications
|
|
|
|
title: "Notifications"
|
|
|
|
---
|
2017-07-04 08:00:31 +02:00
|
|
|
|
|
|
|
Notify was built primarily to use with Slack's Incoming
|
|
|
|
webhooks, but will also deliver a simple payload to
|
|
|
|
any endpoint. Currently only active for `publish` / `create`
|
|
|
|
commands.
|
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
2018-05-24 09:54:25 +02:00
|
|
|
An example with a **HipChat** and **Google Hangouts Chat** hook:
|
2017-07-04 08:00:31 +02:00
|
|
|
|
|
|
|
#### Single notification
|
|
|
|
|
|
|
|
```yaml
|
|
|
|
notify:
|
|
|
|
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"}'
|
|
|
|
```
|
|
|
|
|
|
|
|
#### Multiple notification
|
|
|
|
|
|
|
|
```yaml
|
|
|
|
notify:
|
2018-05-24 09:54:25 +02:00
|
|
|
'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':
|
2017-07-04 08:00:31 +02:00
|
|
|
method: POST
|
2017-07-04 08:02:29 +02:00
|
|
|
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"}'
|
2017-07-04 08:00:31 +02:00
|
|
|
```
|
|
|
|
|
|
|
|
## Configuration
|
|
|
|
|
2017-12-16 13:25:59 +01:00
|
|
|
Property | Type | Required | Support | Default | Description
|
2017-10-26 11:22:45 +02:00
|
|
|
--- | --- | --- | --- | --- | ---
|
|
|
|
method| string | No | all | | HTTP verb
|
|
|
|
packagePattern| string | No | all | | Only run this notification if the package name matches the regular expression
|
2018-01-08 23:04:38 +01:00
|
|
|
packagePatternFlags| string | No | all | | Any flags to be used with the regular expression
|
2017-10-26 11:22:45 +02:00
|
|
|
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
|
2018-05-24 09:54:25 +02:00
|
|
|
content| string | Yes | all | | any [handlebar](https://handlebarsjs.com/) expressions
|