serverless-slack-plugin
v0.1.1
Published
Serverless slack bot which will update a given channel whenever a deployment is completed
Downloads
7
Maintainers
Readme
Serverless Slack Plugin
A Slack Bot plugin for the Serverless Framework which will post updates to a channel on completion of deployments or removals of functions and/or endpoints.
Installation
Make sure you have the Serverless Framework installed and you're using Node.js v4.0+.
Install the plugin in the root of your Serverless Project:
npm install serverless-slack-plugin --save-dev
Add the plugin to the plugins
array in your Serverless Project's s-project.json
, like this:
plugins: [
"serverless-slack-plugin"
]
Configuration
First you will need to configure a "bot user" in your Slack team for the integration, instructions on how to do that can be found in the Slack documentation.
Hint: Don't forget to invite your bot user into the channel you want it to post into!
Once you have generated a token for your bot user and the name of the channel, in the custom
property of either your s-project.json
or s-function.json
add the following:
{
...
"custom": {
"slack": {
"token": "<YOUR SLACK CHAT BOT TOKEN>",
"channel": "<THE CHANNEL YOU WANT TO POST TO>",
"endpoints": true, // All endpoint deployments and removals will result in a message
"functions": {
"deployed": true, // Function deployments will result in a message
"removed": true // Function removals will result in a message
}
}
}
...
}
Note: For both endpoints
and functions
you can either enable/disable deployments and removals discretely or globally as above
Usage
Once configured any of the following actions will result in a summary message being sent to the configured channel.
serverless dash deploy
serverless function deploy
serverless function remove
serverless endpoint deploy
serverless endpoint remove
License
MIT License. See the LICENSE file.