mirror of
https://github.com/verdaccio/verdaccio.git
synced 2025-02-21 07:29:37 +01:00
(doc): Add notifications documentation
This commit is contained in:
parent
432a6c4eaf
commit
8e009d8fe8
@ -14,10 +14,11 @@ from a fresh look at the code and the outstanding issues. So here we are 🎉
|
|||||||
* [Command Line](cli.md)
|
* [Command Line](cli.md)
|
||||||
* [Setting up *uplinks*](uplinks.md)
|
* [Setting up *uplinks*](uplinks.md)
|
||||||
* [Packages Access](packages.md)
|
* [Packages Access](packages.md)
|
||||||
|
* [Enable Notifications](notifications.md)
|
||||||
<!---
|
<!---
|
||||||
* [Logs](logs.md)
|
* [Logs](logs.md)
|
||||||
* [Configure the Web](web.md)
|
* [Configure the Web](web.md)
|
||||||
* [Enable Notifications](notifications.md)
|
|
||||||
* [Understand the storage](storage.md)
|
* [Understand the storage](storage.md)
|
||||||
* [Authorization and access](auth.md)
|
* [Authorization and access](auth.md)
|
||||||
* [Installing Plugins](plugins.md)
|
* [Installing Plugins](plugins.md)
|
||||||
|
55
wiki/notifications.md
Normal file
55
wiki/notifications.md
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
# Notifications
|
||||||
|
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
An example with a **hipchat** hook:
|
||||||
|
|
||||||
|
#### 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:
|
||||||
|
'example-package-1'
|
||||||
|
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
|
||||||
|
|
||||||
|
Property | Type | Required | Support | Description
|
||||||
|
--- | --- | --- | --- | --- | ---
|
||||||
|
method| string | No | all | HTTP verb
|
||||||
|
packagePattern| string | No | all | Only run this notification if the package name matches the regular
|
||||||
|
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
|
||||||
|
|
Loading…
Reference in New Issue
Block a user