Skip to content

CLI for adding missing google pubsub subcriptions from config.json

Notifications You must be signed in to change notification settings

elmy-team/init-pubsub-cli

Repository files navigation

Setup topics & subscriptions required for running cascade message workers

This command is used to setup pubsub topics & subscriptions

How

Install

  • from sources:
npm install
npm run build
npm link
  • using NPM:
npm install -g @elmy-oss/init-pubsub-cli

Run

  • when globally installed
init-pubsub --env=./example.local.env scripts/initPubSub/config.json
  • explicit call using npm / npx
npx @elmy-oss/init-pubsub-cli ./scripts/initPubSub/config.json

Config

Environment variables

  • PUBSUB_EMULATOR_HOST: is the host of the pubsub emulator (edit accordingly when port-forwarding from test envs)
  • PUBSUB_PROJECT_ID: is the project id of the google pubsub project
  • Please note that you have the option to use current shell's environment variables or to utilize an .env file. Additionally, you can specify an alternate dotenv file by using the --env=dotenv-file switch, as demonstrated in the Run section above.

Setup

  • Either copy example.local.env or example.testenv.env to .env and edit accordingly
  • or define environment variables PUBSUB_EMULATOR_HOST & PUBSUB_PROJECT_ID in your shell before running

Topics & subscription mappings are found in a config.json file

{
  "topic1-with-single-sub": ["topic1-sub1"],
  "topic2-with-subs": [
    "topic2-sub1",
    "topic2-sub2"
  ],
  "topic3-without-sub": []
}

About

CLI for adding missing google pubsub subcriptions from config.json

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published