tree: 4a9ef86a60856668f9c0d33b5564e68f702a90f4 [path history] [tgz]
  1. .gcloudignore
  2. README.md
  3. sendwikidiff.go
  4. sendwikidiff_test.go
cloudfns/sendwikidiff/README.md

Go Reference

golang.org/x/build/cloudfns/sendwikidiff

Package sendwikidiff implements a Google Cloud background function that reacts to a pubsub message containing a GitHub webhook change payload.

Deploying

To deploy, run the following command sequence in this directory:

DEPLOYDIR="$(mktemp -d)" && cp -R . ../../go.{mod,sum} "$DEPLOYDIR" && \
(cd "$DEPLOYDIR" && \
go mod edit -module golang.org/x/build/cloudfns/sendwikidiff && go mod tidy && go test ./... && \
gcloud functions deploy HandleWikiChangePubSub \
  --project=symbolic-datum-552 \
  --runtime go120 \
  --trigger-topic github.webhooks.golang.go.wiki \
  --memory 1024 \
  --set-env-vars="SENDGRID_API_KEY=$(gcloud --project=symbolic-datum-552 secrets versions access latest --secret=sendgrid-sendonly-api-key)") && \
rm -rf "$DEPLOYDIR"