Sign inSign up

qnib/slack-relay

By qnib

•Updated about 10 years ago

Image
2

3.5K

qnib/slack-relay repository overview

⁠relay

A shim to get webhook POSTs from Docker Hub and post them to Slack⁠.

⁠Setup

⁠Put your project up on Docker Hub

First, make a Dockerfile⁠ and add it to the root of your repository. You can test it locally with

sudo docker build .

after installing Docker⁠.

Then push your project to Docker Hub⁠.

⁠Make a new Incoming Webhook in Slack's Integrations

Copy the webhook URL.

⁠Webserver-side configuration

Set up dependencies:

sudo apt-get install python-requests python-twisted

Set shell variables for your webhook URL and a port (which can be any integer between 1024 and 65535; we have 8080 here as an example):

export slack_url='https://hooks.slack.com/services/PUT/YOURS/HERE'
export relay_port=8080

Clone this repo. Make a file channel_selector.json in the repo directory that maps the repo path on Docker Hub to a channel in your Slack chat. For example, to map https://registry.hub.docker.com/u/psathyrella/ham/⁠ and our C++ build environment⁠ to the relevant channels, the file would be:

{
    "psathyrella/ham":"#bcell",
    "matsengrp/cpp":"#infrastructure"
}
⁠Run

After running

python relay.py

visit http://your-webserver-goes-here.com:8080/relay⁠ and you should get the message "Relay is running."

Now, when your build pushes to Docker Hub you should get a nice notification in Slack.

Tag summary

Content type

Image

Digest

sha256:b827245bb…

Size

362.9 MB

Last updated

about 10 years ago

docker pull qnib/slack-relay