How to report to Slack¶
With this tutorial, our goal is to explain how to configure eHive and Slack to be able to report messages to a Slack channel.
First of all, you obviously need to have a Slack team. You or someone else will have to be allowed to configure Apps.
Let’s first add the “Incoming WebHooks” app to your team:
- In the main Slack menu select “Apps & Custom Integrations”.
- Find “Incoming WebHooks” via the search box and select it.
- You should be on a page that gives an introduction about WebHooks
and lists the teams you belong to. Somebody may have already
configured some WebHooks for your team.
- If it is the case, click on the “Configure” button next to your team name and then “Add Configuration”.
- Otherwise, click on the “Install” button next to your team name.
Let’s now configure a webhook to use with eHive:
- You first need to choose the channel eHive will write too. Although the Slack API allows to override the channel and thus use a single webhook to post to different channels, we advise to configure one webhook per channel.
- Click “Add Incoming WebHooks Integration”.
- The page now shows advanced configuration for the integration. The most important here is the “Webhook URL”. This is what eHive needs.
- If you scroll down to “Integration Settings” you can give a description for the WebHook, change its name and emoji. Note that the latter can be overridden in the Runnable SlackNotification.
Use the WebHook in eHive:
- Define the
EHIVE_SLACK_WEBHOOK
environment variable when running your Beekeeper. - Configure the
slack_webhook
parameter in the SlackNotification Runnable.