Sign inSign up

bfolkens/gcb-slack-notifier

By bfolkens

•Updated about 8 years ago

A simple notifier for a Google CloudBuild (GCB) step that sends a message to Slack.

Image
0

1.5K

bfolkens/gcb-slack-notifier repository overview

⁠Git/Slack CloudBuild Notification

This is a quick-n-dirty script to notify Slack in a CloudBuild step.

⁠Usage

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.

⁠Example

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/"'

Tag summary

Content type

Image

Digest

Size

10.8 MB

Last updated

about 8 years ago

docker pull bfolkens/gcb-slack-notifier