slack

command
v0.0.0-...-92bc968 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

README

Cloud Build Slack Notifier

This notifier uses Slack Webhooks to send notifications to your Slack workspace.

This notifier runs as a container via Google Cloud Run and responds to events that Cloud Build publishes via its Pub/Sub topic.

For detailed instructions on setting up this notifier, see Configuring Slack notifications.

Configuration Variables

This notifier expects the following fields in the delivery map to be set:

  • webhook_url: The secretRef: <Slack-webhook-URL> map that references the Slack webhook URL resource path in the secrets section.

For release 1.15 and above:

Please do not upgrade to 1.15 as it contains bindings/templating functionality which may break existing slack setups below 1.15. Official documentation will be released detailing usage for bindings/templating, but for now the feature is in alpha so existing users are recommended to use releases older than 1.15.

You can specify the slack version like so:

gcloud run deploy service-name \
   --image=us-east1-docker.pkg.dev/gcb-release/cloud-build-notifiers/slack:slack-1.14.0 \
   --no-allow-unauthenticated \
   --update-env-vars=CONFIG_PATH=config-path,PROJECT_ID=project-id

Slack BlockKit Template Functions

  • The replace function allows replacement of substrings in any {{template variables}} in the .json Slack template. (For example, the variable .Build.FailureInfo.Detail contains double quotes, which breaks the BlockKitTemplate parsing.)
    • Usage: {{replace .Build.FailureInfo.Detail "\"" "'"}}

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL