README.md #4

  • //
  • guest/
  • paul_allen/
  • slack/
  • main/
  • README.md
  • Markdown
  • View
  • Commits
  • Open Download .zip Download (2 KB)

Slack Swarm module

A simple Swarm module that monitors the Project's Activity feed for changes. Changes are sent to the Slack channel specified in the Project's configuration page.

Add Integration

The hyperlinks will take you directly to the Change or user specs in Swarm.

Installation

Swarm 2015.4 is required (the Slack module needs data-access to the Project's configuration).

The Slack module consists of 4 four files...

module/Slack/config/module.config.php
module/Slack/Module.php
module/Slack/src/Slack/Message.php
public/module/Slack/js/Slack.js
  1. Copy the module directory module/Slack into your Swarm's module/... installation directory.

    Typically /opt/swarm/module/...

  2. Copy the remainding file Slack.js into your Swarm's public folder keeping the directory structure module/Slack/js/.

    A typical install destination: /opt/swarm/public/module/Slack/js/Slack.js

  3. Restart your Swarm web service and the you should be ready to use the Slack integration.

Setup

For the Swarm project to talk to Slack you need to add an Incoming Webhook. Open Slack and access the options menu for the channel you want to add the integration. Then select 'Add a service integration ...'

Add Integration

Click on the 'Build your own' button and choose 'Make a Custom Integration', then choose the 'Incoming Webhook' from the list.

Add Incoming Webhook

Find the channel from the list...

Find Channel

then click to add..

Add Add Hook

Copy the Webhook URL

Add Add Hook

and add the Webhook URL to the 'Slack Webhook' box on your Swarm Project's configuration page.

Add Add Hook

'Save' and you are done.

Configuration

The configuration of the module is located in: module/Slack/config/module.config.php you can see the default here.

'slack' => array(
    'user'        => 'Swarm',
    'icon'        => 'https://pbs.twimg.com/profile_images/572920496824406016/Io8m39jD.jpeg',
    'max_length'  => 80
)

The fields are user the name of the Swarm Slack BOT shown in the chat feed. An external URL for icon used for the Slack BOT icon and max_length the number of characters to show from the Change description (default 80 characters).

# Slack Swarm module
A simple Swarm module that monitors the Project's Activity feed for changes.  Changes are sent to the Slack channel specified in the Project's configuration page.

![Add Integration](images/PerforceSlack.png)

The hyperlinks will take you directly to the Change or user specs in Swarm.

## Installation
**Swarm 2015.4 is required** (the Slack module needs data-access to the Project's configuration).

The Slack module consists of 4 four files...

```
module/Slack/config/module.config.php
module/Slack/Module.php
module/Slack/src/Slack/Message.php
public/module/Slack/js/Slack.js
```

1. Copy the module directory `module/Slack` into your Swarm's `module/...` installation directory.
	
	Typically `/opt/swarm/module/...`

2. Copy the remainding file `Slack.js` into your Swarm's `public` folder keeping the directory structure `module/Slack/js/`.

	A typical install destination: `/opt/swarm/public/module/Slack/js/Slack.js`

3. Restart your Swarm web service and the you should be ready to use the Slack integration.

## Setup
For the Swarm project to talk to Slack you need to add an `Incoming Webhook`. Open Slack and access the options menu for the channel you want to add the integration.  Then select 'Add a service integration ...'

![Add Integration](images/AddIntegration.png)

Click on the 'Build your own' button and choose 'Make a Custom Integration', then choose the 'Incoming Webhook' from the list.

![Add Incoming Webhook](images/Incoming.png)

Find the channel from the list...

![Find Channel](images/FindChannel.png)

then click to add..

![Add Add Hook](images/AddHook.png)

Copy the Webhook URL

![Add Add Hook](images/Webhook.png)

and add the Webhook URL to the 'Slack Webhook' box on your Swarm Project's configuration page.

![Add Add Hook](images/SwarmConfig.png)

'Save' and you are done.

##Configuration
The configuration of the module is located in: `module/Slack/config/module.config.php` you can see the default [here](https://swarm.workshop.perforce.com/projects/paul_allen-slack/files/main/module/Slack/config/module.config.php).

    'slack' => array(
        'user'        => 'Swarm',
        'icon'        => 'https://pbs.twimg.com/profile_images/572920496824406016/Io8m39jD.jpeg',
        'max_length'  => 80
    )

The fields are `user` the name of the Swarm Slack BOT shown in the chat feed.  An external URL for `icon` used for the Slack BOT icon and `max_length` the number of characters to show from the Change description (default 80 characters).
 
# Change User Description Committed
#4 18278 Paul Allen Updated setup notes to relect changes to Slack's install pages.
#3 16618 Paul Allen Install notes for Slack integration
#2 16470 Paul Allen Configuration updates to UserGuide.
#1 16468 Paul Allen MarkDown user guide.