跳到主要内容

Slack integration

Learn about how Buddy integrates with Slack and how you can use it to your advantage.

提醒

If you wish to configure Slack integration for your standalone installation of Buddy, please refer to this article

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.

Example pipeline using Slack notification

信息

Buddy is a pipeline delivery automation tool that integrates with Slack and other notification services. Learn how to seamlessly introduce Buddy to your development workflow.

Send messages to a Slack channel

  1. Look up and choose Slack from the Notifications section: Adding Slack action

  2. Sign in to your Slack team and authorize Buddy via OAuth: Authorizing Buddy

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

    You can do it in two ways:

    • by typing @Buddy and inviting the bot to the target chat
    • by clicking the ⚡️ icon on on the target chat and adding the bot as an app

Adding bot app to Slack channel

  1. Once the bot is added, select the Channel to which you want to send the notifications and customize the message: Slack action configuration
提醒

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

Run pipelines with slash commands

Slash commands can be used to trigger things like pipeline executions directly from the Slack channel. To use the commands you must first configure an integration in Slack.

  1. Go to the target pipeline, click Slack handle in the right column and copy the URL: Slack handles
  2. Go to the slash commands section of Slack services.
  3. Enter the name of the command and click Add Slack Command Integration:

Adding Slack slash command integration

  1. In the Integration Settings, paste the URL copied from Buddy and customize the command to your liking.

Supported slash commands

信息

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

  • /[name] status – displays pipeline status
  • /[name] run – runs execution
  • /[name] cancel – cancels execution (must be in progress)
  • /[name] refresh – refreshes execution
  • /[name] retry – runs execution again (must be terminated or canceled)
  • /[name] clear run – deploy and refresh can be used with the clear cache trigger
  • /[name] refresh 1c002dd – deploy and refresh can be used with any revision
  • /[name] clear run 1c002dd – clear and revision can be run together

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

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

Approve waiting pipeline:

  • /[name] approve

Pass params to waiting pipeline:

  • /[name] params a=b c="some text"
信息

You can also run executions with environment variables: /[name] run a=b c="some text".