Slack

Wercker can send notifications on build or deploy events to your Slack channel.

For notifications we leverage after-steps that are executed when a build or deploy finishes.

Various notifications for Slack exist in the step registry, but below we showcase how to use one that wercker has created.

You define after-steps in your wercker.yml either in your build or deploy pipeline (or both!).

after-steps:
        - slack-notifier:
            url: $SLACK_URL
            channel: notifications
            username: werckerbot
            notify_on: "failed"

The url parameter is the slack webhook that wercker should post to. You can create an incoming webhook on your slack integration page. This url is then exposed as an environment variable that you create through the wercker web interface as a deploy pipeline variable.

We encourage you to create a separate room for your notifications

The channel is the Slack chat room that you want the notifications you want to post to. The username defines the name under which notifications should be posted. Finally, the notify_on field specifies if you want to get notifications only on failed builds or deploys.