Skip to content

Latest commit

 

History

History
75 lines (63 loc) · 1.91 KB

README.md

File metadata and controls

75 lines (63 loc) · 1.91 KB

pubsubroller

CircleCI standard-readme compliant

GCP PubSub provisioning tool at a light speed ⚡

Table of Contents

Install

$ go get github.com/IzumiSy/pubsubroller

Usage

 $ pubsubroller --help
Usage:
  pubsubroller [OPTIONS]

Application Options:
  -p, --projectId= target GCP project ID
  -c, --config=    configuration file path
  -e, --endpoint=  service endpoint
      --dry        dry run
      --delete     delete all topics and their subscriptions

Help Options:
  -h, --help       Show this help messag

Configuration Example

variables:
  url: "https://service-of-${projectId}/subscriber"
topics:
  invitedUser:
    subscriptions:
      - name: sendInvitationMail
        endpoint: "${url}/sendInvitationMail"
      - name: sendGroupNotification
        endpoint: "${url}/sendGroupNotification"
      - name: sendReinvitationMail
        pull: true

top level keys are variables, which replaces placeholder in subscription names and endpoints, and topics that have multiple subscriptions.

Troubleshooting

panic: rpc error: code = Unauthenticated desc = transport: oauth2: cannot fetch token: 400 Bad Request

Try checking if your Google Cloud credential is valid or not.

$ gcloud auth application-default print-access-token

Revoke it and re-login if it is not valid.

$ gcloud auth application-default revoke
$ gcloud auth application-default login

Development

$ make

Contributions

PRs accepted

License

MIT © IzumiSy