A generic msgbus based IRC notification tool
910
A little tiny shell-script driven generic IRC notifications tool.
This uses msgbus to subscribe to generic topics (say from webhooks), jq to filter and templateize the payload into an IRC message and irccat to connect to and post on IRC.
Configuration is via environment variables:
JQ_TEMPLATE -- The jq template/expression to use (Required).MSGBUS_URI -- The msgbus endpoint uri to connect to for pushed alertsMSGBUS_TOPIC -- The msgbus topic to subscribe to for alertsIRC_(HOST|PORT|CHAN|NICK) - Various IRC configuration parametersYou can also provide the JQ_TEMPLATE via the first argument like this:
ircnotify:
image: prologic/ircnotify
command: '. | "NOTICE: \(.repo.owner)/\(.repo.name) build \(.build.number) \(.build.status) (\(.build.link))"'
Provide JQ_TEMPLATE via environment:
$ docker run -t -e JQ_TEMPLATE='"NOTICE: \( .message )"' prologic/ircnotify
Provide JQ_TEMPLATE via command-line argument:
$ docker run -t prologic/ircnotify '"NOTICE: \( .message )"'
Use the default JQ_TEMPLATE of '"\(.)"':
$ docker run -t prologic/ircnotify
Some pre-defined templates to help get you started:
'. | "NOTICE: \(.push_data.pusher) pushed image \(.repository.repo_name) with tag \(.push_data.tag)"''. | "NOTICE: \(.repo.owner)/\(.repo.name) build \(.build.number) \(.build.status) (\(.build.link))"''.alerts[] | "ALERT: \(.labels.alertname) \(.status) - \(.annotations.summary)"'Note: When specifying the command: in a docker-compose.yml file
it's best to the pipe | notation for literal interpretation. Example:
version: "3.3"
services:
hello:
image: prologic/ircnotify
command: |
'"\(.message)"'
deploy:
restart_policy:
condition: on-failure
replicas: 1
Content type
Image
Digest
Size
14.3 MB
Last updated
over 6 years ago
docker pull prologic/ircnotify