Skip to content
This repository has been archived by the owner on Jul 16, 2020. It is now read-only.

apartmentlist/heroto_rooter

Repository files navigation

Heroto Rooter

This is a basic Rails API that routes Heroku webhook events to Slack.

Setup

git clone https://github.com/apartmentlist/heroto_rooter.git
bundle install
rake db:create
rake db:migrate

Configuration

Slack (once)

Create a new bot integration and set the API key into the SLACK_API_TOKEN environment varible, which is read into the slack-ruby-client in config/initializers/slack.rb.

Routing (For each app)

Routing is set in the Rooter objects. Add one with the application name, Slack channel, and emoji to use as the avatar.

Rooter.create(
  app: 'heroto-rooter',
  channel: 'log_info',
  emoji: 'speaking_head_in_silhouette'
)

Heroku (For each app)

Heroku needs to know where to send events. You can pick and choose your events if you like, or subscribe to everything with:

./scripts/add_webhooks.rb <host> <app> [app ...]
  • host is your instance's application host, eg. rooter.example.com
  • app is the name (or many names) of the Heroku app to install the webhook on

Adding new notifications

Notifications are looked up by the [resource, action] pair found in an event, for example %w[release create]. To notify about a new event, write a subclass of Notification::Base with the #body you want to post, and then add the class to the Event::NOTIFICATION_MAP, keyed by its resource and action.

License

License: MIT

See the LICENSE file for license rights and limitations.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published