- Serverless 1.x
- Project setup for AWS provider
- Open a terminal to your Serverless project
npm install --save-dev serverless-plugin-notification
- Add
serverless-plugin-notification
in yourserverless.yml
file (see Serverless docs) - Follow platform specific installation
- Notify service deployment to predefined Slack channel with custom username. Supporting states
- Deployment started
- Deployment succeeded
- Deployment failed (TODO)
- Predefined message format - General info in post, function and endpoint listing in thread reply
- Support Slack thread
- Support automatically retrieving deployer name
- EMOJIs !
In your serverless.yml
fill the following configuration
custom:
notification:
deployer: /* Default deployer name, if not automatically retrieve from local variable, if not default to 'Unnamed deployer' */
slack:
token: /* Your slack token here */ - Follow https://api.slack.com/bot-users to get bot access token
channel: /* Your channel name here */ e.g '#serverless' NOTE: Using direct message '@person' will have 'channel_not_found' error at `Deployment succeeded` and `Deployment failed`
username: /* (Optional) Username that will be used to post the message */
- Notify service deployment through http webhook POST using configurable url and headers. Supporting states:
- Deployment started
- Deployment succeeded
- Deployment failed (TODO)
Content-Type
currently support onlyapplication/json
- Does not support CORs
In your serverless.yml
fill the following configuration
custom:
notification:
webhook:
url: /* Your webhook url here */
headers: /* Your headers here - Must be in object format */
Content-Type: application/json