bitbucket-pipeline-slack-notifier
v0.1.2
Published
Send a notification to slack when in a bitbucket pipleline.
Downloads
1
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:'
Below is an example of how to use it in a pipeline.
# my-awesome-repo-thingys
image: node:8.10.0
pipelines:
custom:
Production:
- step:
caches:
- node
script:
- npm install
- npm run lint
- npm test
- node --max-old-space-size=8192 ./node_modules/.bin/serverless deploy -s prod -v
- node ./node_modules/.bin/pnSlackNotifier -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 install
- 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