chore(local): docker-compose stack with MySQL, Redis, Pub/Sub emulator and all services
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM
This commit is contained in:
1 parent
9e7fbeafa4
commit
f4bf239679
7 files changed
+173
-1
No files matched your search
Executable
+15
@@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
# Creates every topic and subscription in topics.txt on the Pub/Sub emulator. Idempotent.
|
||||
set -eu
|
||||
base="http://pubsub:8085/v1/projects/co-lite-local"
|
||||
grep -v '^#' /pubsub/topics.txt | while read -r topic sub; do
|
||||
[ -z "$topic" ] && continue
|
||||
code=$(curl -s -o /dev/null -w '%{http_code}' -X PUT "$base/topics/$topic")
|
||||
case $code in 200|409) ;; *) echo "topic $topic failed: HTTP $code"; exit 1;; esac
|
||||
if [ -n "${sub:-}" ]; then
|
||||
code=$(curl -s -o /dev/null -w '%{http_code}' -X PUT -H 'Content-Type: application/json' \
|
||||
-d "{\"topic\":\"projects/co-lite-local/topics/$topic\"}" "$base/subscriptions/$sub")
|
||||
case $code in 200|409) ;; *) echo "subscription $sub failed: HTTP $code"; exit 1;; esac
|
||||
fi
|
||||
done
|
||||
echo "pubsub-init: done"
|
||||
Reference in new issue
Block a user