Skip to content

Commit

Permalink
chore: fix pubsub emulator initialize
Browse files Browse the repository at this point in the history
  • Loading branch information
ucpr committed Dec 17, 2023
1 parent c553d88 commit f453727
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,19 @@ services:
- "8085:8085"
entrypoint: /bin/bash

pubsub-init:
setup-pubsub-emulator:
image: gcr.io/google.com/cloudsdktool/cloud-sdk:455.0.0-emulators
depends_on:
- pubsub-emulator
environment:
PUBSUB_EMULATOR_HOST: "pubsub-emulator:8085"
command: |
gcloud config configurations create emulator && gcloud config set project dummy-project && gcloud config set auth/disable_credentials true && gcloud pubsub topics create dummy-topic && echo "finish setup pubsub"
bash -c "
until curl -X GET \"http://pubsub-emulator:8085\"; do
sleep 1
done
curl -X PUT "http://pubsub-emulator:8085/v1/projects/dummy-project/topics/dummy-topic"
"
mongo-streamer:
build: .
Expand All @@ -55,6 +60,7 @@ services:
- mongo-primary
- mongo-secondary
- mongo-arbiter
- setup-pubsub-emulator
ports:
- "8080:8080"
develop:
Expand All @@ -71,7 +77,7 @@ services:
METRICS_ADDR: :8080
PUBSUB_PROJECT_ID: "dummy-project"
PUBSUB_TOPIC_ID: "dummy-topic"
PUBSUB_EMULATOR_HOST: "localhost:8085"
PUBSUB_EMULATOR_HOST: "pubsub-emulator:8085"

prometheus:
image: prom/prometheus
Expand Down

0 comments on commit f453727

Please sign in to comment.