hubot-whos-on-call-mattermost

1.1.0 • Public • Published

Build Status npm version dependencies

npm stats

hubot-whos-on-call-mattermost

This script adds a webhook to hubot that can be called periodically to update a Mattermost channel's header text with the name of the on-call engineer via pagerduty.

Sadly, Pagerduty doesn't have a webhook event for a change in schedule, so a cron job of some kind will need to trigger the script periodically. The header isn't updated if the on-call engineer hasn't changed.

See src/whos-on-call.coffee for full documentation.

NOTE: This script requires at least version 3.4.0 of hubot-matteruser

Installation

npm install hubot-whos-on-call-mattermost

Then add hubot-whos-on-call-attermost to your external-scripts.json:

[
  "whos-on-call-mattermost"
]

Triggering the script

Make an HTTP POST request to {HUBOT_HOST}/webhook/on-call/:channel_name

The post body must contain a key called secret that should match the environment variable WHOS_ON_CALL_WEBHOOK_SECRET. This will ensure only authorized clients can trigger the script.

The post body can optionally contain a header key that specifies the text to set the header to. The string $ENGINEER in this variable will be replaced with the on-call engineer's name (as given by pagerduty). Not specifying this value will trigger the use of the WHOS_ON_CALL_HEADER_TEMPLATE environment variable.

Package Sidebar

Install

npm i hubot-whos-on-call-mattermost

Weekly Downloads

4

Version

1.1.0

License

MIT

Last publish

Collaborators

  • cadecairos