notify attribute allows you to trigger build notifications to different services. You can also choose to conditionally send notifications based on pipeline events like build state.
Add notifications to your pipeline with the
notify attribute. This sits at the same level as
steps in your
notify attribute can only be used when using the YAML Step Editor beta.
The below example will send a notification email every time a build is created on this pipeline:
steps: - command: "tests.sh" - wait - command: "build.sh" notify: - email: "email@example.com"
You can trigger notifications as emails, as a message in a Basecamp Campfire, or as a message in a Slack Channel.
You can choose to only trigger notifications when a statement evaluates to true using the
In the below example the email notification will only be triggered if the build passes:
notify: - email: "firstname.lastname@example.org" if: build.state == "passed"
To trigger conditional notifications to a Slack channel, you will first need to configure Conditional notifications for Slack.
Add an email notification to your pipeline using the
notify yaml block:
notify: - email: "email@example.com"
notify: - email: "firstname.lastname@example.org" - email: "email@example.com" - email: "firstname.lastname@example.org"
Basecamp Campfire Message
To send notifications to a Basecamp Campfire, you'll need to set up a chatbot in Basecamp as well as adding the notification to your
pipeline.yml file. Basecamp admin permission will be required to setup your chatbot.
Campfire messages can only be sent using Basecamp 3.
- Add a chatbot to the Basecamp project or team that you'll be sending notifications to.
- Set up your chatbot with a name and an optional URL. If you'd like to include an image, you can find the Buildkite logo in our Brand Assets.
- On the next page of the chatbot setup, copy the URL that Basecamp provides in the
- Add a Basecamp notification to your pipeline using the
basecamp_campfireattribute of the
notifyyaml block and the URL copied from your Basecamp chatbot:
notify: - basecamp_campfire: "https://3.basecamp.com/1234567/integrations/qwertyuiop/buckets/1234567/chats/1234567/lines"
basecamp_campfire attribute accepts a single URL as a string.
Slack Channel Message
To send notifications to a Slack Channel, first set up the Slack notification service in your Organization's notification settings. Detailed instructions for setting up a Slack notification service can be found in the Slack integration guide.
Add a Slack notification to your pipeline using the
slack attribute of the
notify yaml block:
notify: - slack: "#general"
When using just a channel name, you must specify it in quotes, as otherwise the
# will cause the channel name to be treated as a comment.
The above example will deliver the notification to all configured workspaces that have a channel named 'general'.
To send a notification to one particular workspace and channel, you can specify the workspace name:
notify: - slack: buildkite-community#general
You can also specify multiple teams and channels with the
notify: - slack: channels: - buildkite-community#sre - buildkite-community#announcements - buildkite-team#monitoring - "#general"
In the example above, the notification will be sent to the 'sre' and 'announcements' channels in the 'buildkite-community' workspace, the 'monitoring' channel in the 'buildkite-team' workspace, as well as to the 'general' channel of all configured workspaces.