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.
The hyperlinks will take you directly to the Change or user specs in Swarm.
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
Copy the module directory module/Slack
into your Swarm's module/...
installation directory.
Typically /opt/swarm/module/...
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
Restart your Swarm web service and the you should be ready to use the Slack integration.
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 ...'
Click on the 'Build your own' button and choose 'Make a Custom Integration', then choose the 'Incoming Webhook' from the list.
Find the channel from the list...
then click to add..
Copy the Webhook URL
and add the Webhook URL to the 'Slack Webhook' box on your Swarm Project's configuration page.
'Save' and you are done.
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).