Giter Site home page Giter Site logo

hadican / failedkite Goto Github PK

View Code? Open in Web Editor NEW
18.0 2.0 2.0 30 KB

A webhook for Buildkite to notify users via DM on Slack for failed builds.

License: Apache License 2.0

Dockerfile 3.50% Python 72.31% Smarty 24.19%
buildkite buildkite-plugin ci-cd continuous-delivery continuous-deployment continuous-integration notification slack webhook webhook-server

failedkite's Introduction

Failedkite

Failedkite is a webhook project for Buildkite to notify users via direct message (DM) on Slack for failed builds.

Currently, on Buildkite integration settings, you can only notify users via public/private #channel, not individually.

How it works?

This application provides a webhook that should be triggered when a build fails on your Buildkite, which will be like http://your_host:8080/webhook.

Please note that it is better to secure your connection using SSL/TLS to protect sensitive data. In a production environment, we recommend creating a reverse proxy with nginx or a similar tool and securing your connection with SSL.

You can get more information about Buildkite Webhooks here.

Dependencies

  • Python 3.11
  • Flask 2.3.2
  • slackclient 2.9.4
  • gunicorn 21.2.0
  • PyYAML 6.0.1

Usage

You need:

  • GitHub username to Slack email address mapping file (author mapping)
  • A Slack token (more info).
  • Running failedkite webhook set on Buildkite integration settings (more info).

You can run a Docker container with the existing image on Docker Hub:

docker run -v ./author_mapping.yml:/config/author_mapping.yml \
           -e SLACK_TOKEN=your_slack_token \
           -e DEFAULT_SLACK_EMAIL=your_default_email \
           -p 8080:8080 -d hadican/failedkite:latest

This application listens on port 8080 and the endpoint /webhook is exposed for receiving Buildkite webhook requests.

Author Mapping

You need to provide an author_mapping.yml file located in the /config directory which matches GitHub usernames to Slack email addresses. If no match is found, then DEFAULT_SLACK_EMAIL is notified.

Environment Variables

You need to set the following environment variables:

  • SLACK_TOKEN: This is your Slack token, which you can obtain here.
  • DEFAULT_SLACK_EMAIL: This is the default email address to be notified when the author cannot be identified.

Build Your Own Image

Your Dockerfile is set to run the app. Here's a basic idea of the Docker commands:

To build the Docker image:

docker build -t failedkite .

To run the Docker container:

docker run -v ./author_mapping.yml:/config/author_mapping.yml \
           -e SLACK_TOKEN=your_slack_token \
           -e DEFAULT_SLACK_EMAIL=your_default_email \
           -p 8080:8080 -d failedkite

failedkite's People

Contributors

hadican avatar kiracih avatar umutphp avatar vinivasundharan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

failedkite's Issues

Auto Deploy Image to DockerHub

We can build the image and push it to DockerHub with an Github action. We need to have the following secrets for the repo.

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.