Knowledge

How to send notifications with Slack?

Buddy allows you to build apps and websites with code from your Git repository. You can synchronize it with GitHub, GitLab or Bitbucket, or use its own fully-featured Git hosting.

Integrating Buddy with Slack will keep your team updated with automatic notifications on finished builds and deployments to a Slack channel. All you need to do is add the dedicated action to your pipeline.

Here's how:

  1. Create or update a pipeline and add Slack notification to the action list
  2. Sign in to your Slack team
  3. Authorize Buddy to access Slack
  4. Select the channel to which you want to send notifications
  5. Type the Contents of the message
  6. Click the button to Test & Save change

You can use parameters to specify the variables within the message. The default notification looks like this:

    ${execution.pipeline.name} execution #${execution.id}

Which basically translates to a message like this:

    Upload to FTP execution #12
Configuring Slack action (click to enlarge)
Configuring Slack action (click to enlarge)

Notification parameters

You can use these parameters in the message contents:

${workspace.html_url}
${workspace.name}
${workspace.domain}
${invoker.avatar_url}
${invoker.email}
${project.html_url}
${project.name}cd
${project.display_name}
${project.repository_type}
${execution.id}
${execution.html_url}
${execution.start_date}
${execution.automatic}
${execution.refresh}
${execution.status}
${execution.comment}
${execution.pipeline.html_url}
${execution.pipeline.name}
${execution.branch}

You can fetch more variables from the release object using:

${execution.action_executions.get(0).to_revision}

Here's an example execution object:

{
  "workspace": {
    "url": "https://api.buddy.works/workspaces/buddy",
    "html_url": "https://app.buddy.works/buddy",
    "id": 200000,
    "name": "buddy",
    "domain": "buddy"
  },
  "invoker": {
    "url": "https://app.buddy.works/buddy/member/1",
    "html_url": "https://app.buddy.works/buddy/profile/1",
    "id": 1,
    "name": "Mike Benson",
    "avatar_url": "https://app.buddy.works/image-server/user/0/0/0/0/0/0/1/d643744fbe5ebf2906a4d075a5b97110/w/32/32/AVATAR.png",
    "title": "Creative director",
    "email": "mike@buddy.works"
  },
  "project": {
    "url": "https://api.buddy.works/projects/company-website",
    "html_url": "https://app.buddy.works/buddy/company-website",
    "name": "company-website",
    "display_name": "Company Website",
    "status": "ACTIVE"
  },
  "current_date": "2016-03-11T06:54:07.428Z",
  "execution": {
    "url": "https://api.buddy.works/projects/company-website/pipelines/2/executions/1",
    "html_url": "https://app.buddy.works/buddy/company-website/pipelines/pipeline/2/execution/56e26b8c99f1e1efed2fc65e",
    "id": 1,
    "start_date": "2016-03-11T06:54:04.728Z",
    "finish_date": "2016-03-11T06:54:06.928Z",
    "mode": "MANUAL",
    "refresh": false,
    "status": "SUCCESSFUL",
    "comment": "",
    "branch": "master",
    "creator": {
      "url": "https://app.buddy.works/buddy/member/1",
      "html_url": "https://app.buddy.works/buddy/profile/1",
      "id": 1,
      "name": "Mike Benson",
      "avatar_url": "https://app.buddy.works/image-server/user/0/0/0/0/0/0/1/d643744fbe5ebf2906a4d075a5b97110/w/32/32/AVATAR.png",
      "title": "Creative director",
      "email": "mike@buddy.works"
    },
    "pipeline": {
      "url": "https://api.buddy.works/projects/company-website/pipelines/2",
      "html_url": "https://app.buddy.works/buddy/company-website/pipelines/pipeline/2/execution/56e26b8c99f1e1efed2fc65e",
      "id": 2,
      "name": "dev",
      "ref_name": "master"
    },
    "action_executions": [
      {
        "to_revision": "506a3963507943d6908154f4bc9646e829128a08",
        "status": "SUCCESSFUL",
        "progress": 100,
        "action": {
          "url": "https://api.buddy.works/projects/company-website/pipelines/2/actions/5",
          "html_url": "https://app.buddy.works/buddy/company-website/pipelines/action/5/edit",
          "id": 5,
          "name": "Upload files to dev",
          "type": "FTP",
          "trigger_time": "ON_EVERY_EXECUTION",
          "run_only_on_first_failure": false,
          "status": "SUCCESSFUL",
          "revision": null
        }
      }
    ]
  }
}

Join our development automation movement!

Download On-Premises Installation