Skip to content

ivkos/cloud-build-notifier

Repository files navigation

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 protected],[email protected],SENDGRID_API_KEY=very.secret'