pn-slack-notify
v1.0.4
Published
Send a notification to slack when in a bitbucket pipeline.
Downloads
21
Readme
Script for sending notification to slack from Bitbucket pipelines in the cases where you cannot utilize the built in slack notification behavior in Bitbucket because of reasons.
Variables
- -message 'This is the message that will show up in slack'
- -team 'The name of the team that is responsible for this repo'
- -channel 'The slack channel where the message should be sent'
- -webhook 'The slack webhook url. This can be setup as a bitbucket pipeline secured variable called
webhook
or you can send it in as a command line argument' - -icon 'Must be a slack icon in the format :icon-name:'
Installing
Save as a devDependency:
npm install -D pn-slack-notify
Example bitbucket pipeline
# my-awesome-repo-thingys
image: node:16
pipelines:
custom:
Production:
- step:
caches:
- node
script:
- npm ci
- npm run lint
- npm test
- node --max-old-space-size=8192 ./node_modules/.bin/serverless deploy -s prod -v
- ./node_modules/.bin/pn-slack-notify -message 'Prod deployment successfully done!' -team 'Red Team' -channel '#deployments' -icon ':package:' -webhook 'htts://path-to-slack-webhook'
branches:
master:
- step:
caches:
- node
script:
- npm ci
- npm run lint
- npm test
- node --max-old-space-size=8192 ./node_modules/.bin/serverless deploy -s test -v
- ./node_modules/.bin/serverless s3deploy -s test