Slack integration

Integrating Buddy with Slack will keep your team updated with automatic notifications on finished builds and deployments to a Slack channel. You can also use it to trigger and get the status of your pipelines with slash commands.

Adding integration

  1. Navigate to Integrations, click Add new integration, and look up Slack on the service list.
  2. Set the name and the sharing scope.
  3. Authorize Buddy in the selected Slack workspace.

You can add more Slack integrations in the Slack action.

Sending messages

Adding the integration will install a bot to your Slack account. The bot has no permissions to private channels and needs to be added manually.

  1. Right-click on the desired channel and select View channel details.
  2. Switch to the Integrations tab and click Add an App.
  3. You should see Buddy in the list of apps installed in your Slack workspace. Click Add to activate it in your channel:

Adding Buddy app to the channelAdding Buddy app to the channel

If you don't see Buddy on the Slack workspace list, the best idea is to remove the integration from Buddy and add it again, ensuring you've selected the correct Slack account and workspace.

  1. Now that Buddy is allowed to send messages, you can add the Slack action to the pipeline:

Slack location in action rosterSlack location in action roster

  1. In the action details, select the channel where you installed the bot. You can customize the message to your liking using environment variables.

Slack message configuration screenSlack message configuration screen

Regardless of the integration's permission scopes, you still need to be a member of the Slack channel to send messages to it.

Slash commands

Slash commands are used for ChatOps interactions between Buddy and Slack. To use slash commands, you first need to configure a Slack application that binds the request URL of the pipeline with the desired command:

  1. Add a new application via the Slack API panel.
  2. Select From scratch configuration, enter the App Name (e.g. Buddy Slash Commands), and pick your Slack workspace.
  3. Click Slash Commands in the features and functionality section.
  4. Click Create New Command, fill in the mandatory fields, and save changes to continue. Repeat for all pipelines that you want to serve.

    • Command: the name of the command that will trigger the desired operation from Slack. The best idea is to set it to the name of the target pipeline, e.g. /prod-stage
    • Request URL: the unique Slack handle of the target pipeline
    • Short description: e.g. "Staging pipeline in Production"

Adding commands to appAdding commands to app

Eventually, you should end up with a list like this:

Commands in slash commands appCommands in slash commands app

  1. When ready, go to SettingsInstall app and click Install to Workspace to activate the app in your Slack workspace.
  2. The last step is adding the app to the Slack channel from which you want to run the commands – just like with the messaging bot.

Once done, you should see the app in the channel details:

Slack channel details with slash commands appSlack channel details with slash commands app

Slack handle location

The request URL – also known as Slack handle – is required to identify the pipeline in Buddy. It is unique to every pipeline and can be found in the dropdown options on the pipeline overview:

Slack handle locationSlack handle location

Supported commands

The [name] parameter represents the name of the command in the Slack application.

Example: /prod-stage clear run 1c002dd – clears pipeline cache and runs deployment from revision 1c002dd in pipeline tied to /prod-stage command.

  • /[name] status – displays pipeline status
  • /[name] run – runs pipeline. Can be used with params. Can be used with any revision.
  • /[name] approve – approves waiting pipeline
  • /[name] params a=b c="some text" – passes parameters to another pipeline
  • /[name] cancel – cancels pipeline execution (must be in progress)
  • /[name] refresh – runs pipeline from scratch. Can be used with any revision.
  • /[name] retry – runs execution again (must be terminated or canceled)
  • /[name] clear run – clears pipeline cache. Can be used with run and refresh. Can be used with any revision.

For wildcard pipelines, you can send branch, tag, and pull request parameters:

  • /[name] clear run tag=1.1
  • /[name] clear run branch=dev
  • /[name] clear run pullRequest=feature-update

Last modified on July 20, 2022

Get Started

Sign up for free and deploy your project in less than 10 minutes.