A simple program for provisioning Pub/Sub topics and subscriptions for the firebase-tools emulator for local testing.
See a working example of how to use it here.
In a docker-compose
file with a firebase-tools
service, add another service that pulls the pubsub-provisioner docker image.
On your pubsub-provisioner
service, set the PUBSUB_EMULATOR_HOST
environment variable and pass the JSON config for your Pub/Sub in this format:
{
"projectId": "pubsub-provisioner-example",
"topics": [
{
"topicId": "my-topic",
"subscriptions": [
{
"type": "push",
"subscriptionId": "my-topic-subscription",
"ackDeadlineSeconds": 10,
"pushEndpoint": "http://my-push-endpoint:1234"
}
]
}
]
}