Skip to content

envato/build-failed-notify-slack-buildkite-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Failed Notify Slack Buildkite Plugin

Buildkite has a notifications feature that can notify channels in slack about build status. The problem is that it's missing a mapping to the build creator's slack ID.

This plugin uses the notifications feature and a mapping file to @at the creator of a failed build.

Example

Add the following to your pipeline.yml:

steps:
  - label: ":slack: Notify on fail"
    if: build.branch == "main"
    plugins:
      - envato/build-failed-notify-slack#v1.1.0:
          mapping_file: slack_users.json
          channel: "#my-channel"

Mapping files can be downloaded from s3

steps:
  - label: ":slack: Notify on fail"
    if: build.branch == "main"
    plugins:
      - cultureamp/aws-assume-role#v0.2.0:
          role: "arn:aws:iam::123456789012:role/example-role"
      - envato/build-failed-notify-slack#v1.1.0:
          mapping_file: s3://my-bucket/slack_users.json
          channel: "#my-channel"

Configuration

mapping_file (Required, string)

JSON file with an array of users slack id's and email addresses (email used in Buildkite, appears as BUILDKITE_BUILD_CREATOR_EMAIL)

eg.

[
  {
    "email": "[email protected]",
    "slackId": "U1234"
  },
  {
    "email": "[email protected]",
    "slackId": "U5678"
  }
]

channel (Required, string)

Including the hash, a channel in slack.

Note

The slack channel must be configured to receive notifications with the Buildkite Builds Slack app. More support for integrating with Buildkite can be found in their documentation

Developing

To run the tests:

docker-compose run --rm tests

To run the linting:

docker-compose run --rm lint

About

@'s the creator of the failed build via a mapping file

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages