/cloud-build-notifier

Sends email notifications for Google Cloud Build

Primary LanguageTypeScriptMIT LicenseMIT

Cloud Build Notifier

Function for Google Cloud Functions that listens on Cloud Build's pub/sub topic for build status updates, and sends email via SendGrid.

Deploy

  1. Obtain an API key for SendGrid.
  2. Configure the function name, the region, the pub/sub topic, and the environment variables in the example below.
  3. Run the command:
gcloud functions deploy \
    cloud-build-notifier \
    --region=europe-west1 \
    --trigger-topic=cloud-builds \
    --source=. \
    --entry-point=handleEvent \
    --runtime=nodejs10 \
    --memory=128MB \
    --update-env-vars='EMAIL_FROM=builds@example.com,EMAIL_TO=you@example.com,SENDGRID_API_KEY=very.secret'