Slack

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:

  • Successful
  • Failed
  • 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:

Example of Slack notification for system-terminated build

Example of Slack notification for system-terminated build

Set up global Slack integration in Codefresh

  1. In the Codefresh UI, on the toolbar, click the Settings icon, and then from the sidebar, select Pipeline Integrations.
  2. Select Slack and then click Configure.
  3. To enable notifications for Slack, select Enable this to activate Slack integration.
  4. Select Quick Setup, do the following:
    1. Click Add to Slack.
      You are redirected to the Slack sign-in page.
    2. If required log in with your Slack credentials, and then select the destination channels for the notifications.
  5. For Custom Webhooks, paste the URL of your Slack application.
  6. Select the types of notifications to receive on Slack.
  7. Click Save.

Add Slack integration

Add Slack integration

How Slack notifications work

When you have Slack integration enabled:

  1. All pipelines launched automatically by triggers, send Slack notifications
  2. 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.

Select to send notifications for manually executed builds

Select to send notifications for manually executed builds

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:

Git triggers in pipelines
Cron triggers in pipelines
Email notifications for pipelines
Creating pipelines
Monitoring pipelines