A wercker after-step slack notifier written in bash and curl. Make sure you create a Slack webhook first (see the Slack integrations page to set one up).
This is based on the official build step. Why? as we have added the notify_on
option failed_or_passed_after_failed
.
Options are applied via organisation environment, pipeline environment or the wercker.yml
.
Option | Description | Environment |
---|---|---|
url |
The Slack webhook URL (REQUIRED) The url parameter is the slack webhook that wercker should post to. You can create an incoming webhook on your slack integration page. |
SLACK_NOTIFIER_URL |
channel |
The Slack channel (excluding # ) |
SLACK_NOTIFIER_CHANNEL |
username |
Username of the notification message. i.e. who it is sent by. | SLACK_NOTIFIER_USERNAME |
icon_url |
A url that specifies an image to use as the user avatar icon in Slack | SLACK_NOTIFIER_ICON_URL |
notify_on |
If set. Possible values failed , passed or failed_or_passed_after_failed . Default is all .
|
SLACK_NOTIFIER_NOTIFY_ON |
branch |
If set, it will only notify on the given branch | SLACK_NOTIFIER_BRANCH |
wercker_token |
This is a wercker API token that can access the application. Required for the notify_on value failed_or_passed_after_failed . |
SLACK_NOTIFIER_WERCKER_TOKEN |
Some examples
build:
after-steps:
- kingsquare/kelevra-slack-notifier:
url: $SLACK_URL
channel: notifications
username: myamazingbotname
branch: master
SLACK_URL
is set in the pipeline or organisation environment.
For easiest integration in to your application's wercker.yml
add options as environment variables to your organisation. Then you can just:
build:
after-steps:
- kingsquare/kelevra-slack-notifier
build:
after-steps:
- kingsquare/kelevra-slack-notifier
notify_on: failed_or_passed_after_failed
Using the wercker-cli
The MIT License (MIT)
- Initial release based on the official build step