Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Drone CI slack template. more on drone.io + slack integration: http://plugins.drone.io/drone-plugins/drone-slack/
pipeline:
build:
image: alpine
commands:
- echo "do something :v"
slack:
image: plugins/slack
channel: dev__builds
webhook: https://hooks.slack.com/services/...
# here's the template :)
# notice that the repo endpoint is hardcoded to `https://github.com/`.
# you may adjust it accordingly.
template: >
{{#if build.pull }}
*{{#success build.status}}✔{{ else }}✘{{/success}} {{ uppercasefirst build.status }}*: <https://github.com/{{ repo.owner }}/{{ repo.name }}/pull/{{ build.pull }}|Pull Request #{{ build.pull }}>
{{else}}
*{{#success build.status}}✔{{ else }}✘{{/success}} {{ uppercasefirst build.status }}: Build #{{ build.number }}* (type: `{{ build.event }}`)
{{/if}}
Commit: <https://github.com/{{ repo.owner }}/{{ repo.name }}/commit/{{ build.commit }}|{{ truncate build.commit 8 }}>
Branch: <https://github.com/{{ repo.owner }}/{{ repo.name }}/commits/{{ build.branch }}|{{ build.branch }}>
Author: {{ build.author }}
<{{ build.link }}|Visit build page ↗>
@wzulfikar

This comment has been minimized.

Copy link
Owner Author

@wzulfikar wzulfikar commented Aug 3, 2018

And here's how the template will look like in slack:
screen shot 2018-08-04 at 3 40 03 am

@ivermac

This comment has been minimized.

Copy link

@ivermac ivermac commented Sep 10, 2020

Thanks for this! Got me started with drone and slack integration

@wzulfikar

This comment has been minimized.

Copy link
Owner Author

@wzulfikar wzulfikar commented Sep 15, 2020

With pleasure!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment