GithubHelp home page GithubHelp logo

00mjk / cloud-build-notifiers Goto Github PK

View Code? Open in Web Editor NEW

This project forked from googlecloudplatform/cloud-build-notifiers

0.0 0.0 0.0 346 KB

Notifier images for Cloud Build, complete with build status filtering and Cloud Secret Manager integration

License: Apache License 2.0

Dockerfile 5.15% Go 89.16% Shell 5.69%

cloud-build-notifiers's Introduction

Cloud Build Notifiers

This repo provides deployable notifier images and sources, as well as libraries for creating new notifiers.

Cloud Build notifiers are Docker containers that connect to the Cloud Build Pub/Sub topic that adapt Pub/Sub messages about Build update notifications to other services/protocols, such as SMTP for email. Cloud Build notifiers are long-lived binaries that receive notifications throughout Builds' lifecycles (e.g. from the Build starting to execute through the Build finishing).

All notifiers can be built by Cloud Build and deployed on Cloud Run. The only prerequisite is to be a Cloud Build user and to have the gcloud CLI tool installed and configured for your Cloud Build project(s).

There are currently 3 supported notifier types:

  • bigquery, which writes Build updates and related data to a BigQuery table.
  • http, which sends (HTTP POSTs) a JSON payload to another HTTP endpoint.
  • slack, which uses a Slack webhook to post a message in a Slack channel.
  • smtp, which sends emails via an SMTP server.

See the official documentation on Google Cloud for how to configure each notifier:

Setup Script

A setup script exists that should automate most of the notifier setup.

Run ./setup.sh --help for usage instructions.

Common Flags

The following are flags that belong to every notifier via inclusion of the lib/notifiers library.

--smoketest

This flag starts up the notifier image but only logs the notifier name (via type) and then exits.

--setup_check

This flag starts up the notifier, which does the following:

  1. Read the notifier configuration YAML from STDIN.
  2. Decode it into a configuration object.
  3. Attempt to call notifier.SetUp on the given notifier using the configuration and a faked-out SecretGetter.
  4. Exit successfully unless one of the previous steps failed.

This can be done using the following commands:

# First build the notifier locally.
$ sudo docker build . \
    -f=./${NOTIFIER_TYPE}/Dockerfile --tag=${NOTIFIER_TYPE}-test
# Then run the `setup_check` with your YAML.
# --interactive to allow reading from STDIN.
# --rm to clean/remove the image once it exits.
$ sudo docker run \
    --interactive \
    --rm \ 
    --name=${NOTIFIER_TYPE}-test \
    ${NOTIFIER_TYPE}-test:latest --setup_check --alsologtostderr -v=5 \
    < path/to/my/config.yaml 

License

This project uses an Apache 2.0 license.

Contributing

See here for contributing guidelines.

Support

There are several ways to get support for issues in this project:

Note: Issues filed in this repo are not guaranteed to be addressed. We recommend filing issues via the Issue Tracker.

cloud-build-notifiers's People

Contributors

ansky avatar aric1088 avatar codrienne avatar emoryruscus avatar ichaelm avatar jessieliu1 avatar lozord avatar navierula avatar seenkey avatar wlynch avatar zchee avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.