Get Slack notifications with pipeline integrations
You can integrate Slack globally, or for specific pipelines and builds. Codefresh can post notifications to Slack, for example, for successful and failed builds, and direct messages received within the Codefresh app.
To integrate through a custom webhook, see the Slack documentation.
You can also look at our example on how to set up a custom webhook notification to Slack.
Notification options for Slack
Enable notifications for builds based on their status:
- Pending manual approval to continue
- Terminated by system
When selected, you receive notifications based on the build termination policies configured for the pipeline. These can be whenever:
- Previous builds from the same or a specific branch are terminated once a build is created for that branch
- Running builds are terminated once a build is created
- Child builds are terminated when the parent build is terminated
Here’s an example of the notification in Slack for a system-terminated build:
Set up global Slack integration in Codefresh
- In the Codefresh UI, on the toolbar, click the Settings icon, and then from the sidebar, select Pipeline Integrations.
- Select Slack and then click Configure.
- To enable notifications for Slack, select Enable this to activate Slack integration.
- Select Quick Setup, do the following:
- Click Add to Slack.
You are redirected to the Slack sign-in page.
- If required log in with your Slack credentials, and then select the destination channels for the notifications.
- Click Add to Slack.
- For Custom Webhooks, paste the URL of your Slack application.
- Select the types of notifications to receive on Slack.
- Click Save.
How Slack notifications work
When you have Slack integration enabled:
- All pipelines launched automatically by triggers, send Slack notifications
- All pipelines executed manually, do NOT send Slack notifications. You can override the default behavior for notifications through the Report notification on pipeline execution option for pipelines. This is available under Advanced Settings for Git and Cron triggers, or the Run settings of a pipeline. When selected, sends email notifications for pipelines which are executed manually.
Individual pipeline Slack integration
If you wish for more fine-grained control over Slack notifications, then take a look at any of the available slack plugins: