Skip to content
This repository has been archived by the owner on Nov 29, 2017. It is now read-only.

cloudfoundry-community-attic/slack-notification-resource-boshrelease

Repository files navigation

BOSH Release for slack-notification-resource

Send messages to your Slack channels from Concourse:

example

This BOSH release packages @Nopik's slack-notification-resource for Concourse, to make it simple to include the additional Concourse resource in your BOSH deployed Concourse system.

Final releases are automatically created based on any changes to the upstream slack-notification-resource

See the build pipeline https://ci.starkandwayne.com/pipelines/slack-notification-resource-boshrelease for status.

Final releases are available on https://bosh.io/releases as well as this project's own GitHub releases.

Installation

To use this bosh release, first upload it to the BOSH/bosh-lite that is running Concourse:

bosh upload release https://bosh.io/d/github.com/cloudfoundry-community/slack-notification-resource-boshrelease

Next, update your Concourse deployment manifest to add the resource.

Add the slack-notification-resource release to the list:

releases:
  - name: concourse
    version: latest
  - name: garden-linux
    version: latest
  - name: slack-notification-resource
    version: latest

Into the worker job, add the {release: slack-notification-resource, name: slack-notification-resource} job template that will install the package:

jobs:
- name: worker
  templates:
    ...
    - {release: slack-notification-resource, name: slack-notification-resource}

The final change is to add the slack-notification-resource package to the list of additional_resource_types:

jobs:
- name: worker
  ...
  properties:
    groundcrew:
      additional_resource_types:
      - type: slack-notification
        image: /var/vcap/packages/slack-notification-resource

And bosh deploy your Concourse manifest.

Usage

First, register a new webhook and select a default channel to send messages https://starkandwayne.slack.com/services/new/incoming-webhook

Slack will give you a URL like https://hooks.slack.com/services/XXXX/XXX/XXXX.

An example mini-pipeline that would send an alert:

---
jobs:
- name: alert
  public: true
  plan:
  - task: say-hello
    config:
      platform: linux
      image: "docker:///ubuntu"
      run:
        path: echo
        args: ["Hello, world!"]
  - put: alert
    params:
      text: Hi everybody!
      channel: "#general"
      username: concourse
      icon_url: http://cl.ly/image/3e1h0H3H2s0P/concourse-logo.png

resources:
- name: alert
  type: slack-notification
  source:
    url: https://hooks.slack.com/services/XXXX/XXX/XXXX

This will display the message with an icon for the avatar:

example

Setup pipeline in Concourse

fly -t snw c -c pipeline.yml --vars-from credentials.yml slack-notification-resource-boshrelease