A simple notifier for a Google CloudBuild (GCB) step that sends a message to Slack.
1.5K
This is a quick-n-dirty script to notify Slack in a CloudBuild step.
When the notify.sh script runs inside the container, it expects the following ENVs:
GIT_PERMALINK_PATTERN="https://github.com/[your-repo]/[your-project]/$GIT_COMMIT_SHA/"
SLACK_WEBHOOK_URL=[your url]
Where $GIT_COMMIT_SHA will be replaced with the commit (if quoted properly). Otherwise, you can use the $REVISION_ID substitution from CloudBuild.
Add the following to your cloudbuild.yaml (replacing vars with your own):
- name: 'bfolkens/gcb-slack-notifier'
env:
- 'SLACK_WEBHOOK_URL=https://hooks.slack.com/services/ABACADABA/DEADBEEF/and0n3m0r3v4r'
- 'GIT_PERMALINK_PATTERN="https://github.com/bfolkens/gcb-slack-notifier/$REVISION_ID/"'
Content type
Image
Digest
Size
10.8 MB
Last updated
about 8 years ago
docker pull bfolkens/gcb-slack-notifier