Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
107 lines (86 sloc) 2.5 KB
date title author tags logo repo image
2018-04-19 00:00:00 +0000
Slack Blame
drone-plugins
notifications
chat
slack.svg
drone-plugins/drone-slack-blame
plugins/slack-blame

Use the Slack Blame plugin to send a message to a Slack channel or through direct message when a build completes. You will need to supply Drone with an access token to the Slack API. You can create a new access token at https://api.slack.com/web. The below pipeline configuration demonstrates simple usage:

pipeline:
  slack_blame:
    image: plugins/slack-blame
    token: your-secret-token
    channel: dev
    success_template: |
      The build is fixed! Thanks @{{slack.name}}
    success_image_attachments:
      - "http://i.imgur.com/TP4PIxc.jpg"
    failure_template: |
      The build is broken! Blame {{slack.name}}
    failure_image_attachments:
      - "http://cdn.meme.am/instances/51000361.jpg"

Example configuration with custom username:

pipeline:
  slack_blame:
    image: plugins/slack-blame
    token: your-secret-token
    channel: dev
    success_template: |
      The build is fixed! Thanks @{{slack.name}}
    success_image_attachments:
      - "http://i.imgur.com/TP4PIxc.jpg"
+   success_username: successbot
    failure_template: |
      The build is broken! Blame {{slack.name}}
    failure_image_attachments:
      - "http://cdn.meme.am/instances/51000361.jpg"
+   failure_username: failurebot

Example configuration using a secret:

pipeline:
  slack_blame:
    image: plugins/slack-blame
-   token: your-secret-token
+   secrets: [ slack_token ]
    channel: dev
    success_template: |
      The build is fixed! Thanks @{{slack.name}}
    success_image_attachments:
      - "http://i.imgur.com/TP4PIxc.jpg"
    failure_template: |
      The build is broken! Blame {{slack.name}}
    failure_image_attachments:
      - "http://cdn.meme.am/instances/51000361.jpg"

Secret Reference

slack_token : Slack access token

Parameter Reference

token : Slack access token

channel : Slack channel

mapping : Mapping of authors to Slack users

success_username : Username for successful builds

success_icon : Icon for successful builds

success_template : Template for successful builds

success_image_attachments : List of image attachments for successful builds

failure_username : Username for failed builds

failure_icon : Icon for failed builds

failure_template : Template for failed builds

failure_image_attachments : List of image attachments for failed builds