diff options
| author | Bobby <[email protected]> | 2026-03-10 23:58:16 +0530 |
|---|---|---|
| committer | Bobby <[email protected]> | 2026-03-10 23:58:16 +0530 |
| commit | 0014f60955760ffd6bd6bfd2e01ada6ea2502f81 (patch) | |
| tree | 5f6a17161a618d59d51edc9d6f2cc0ebe95d65d7 /scripts/entrypoint.sh | |
| parent | fd9d558154eac3585310626f697b943d90e1bf7f (diff) | |
| download | pagoda-0014f60955760ffd6bd6bfd2e01ada6ea2502f81.tar.xz pagoda-0014f60955760ffd6bd6bfd2e01ada6ea2502f81.zip | |
feat: enhance entrypoint and seed scripts with improved logging and batch processing for database seeding
Diffstat (limited to 'scripts/entrypoint.sh')
| -rw-r--r-- | scripts/entrypoint.sh | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/scripts/entrypoint.sh b/scripts/entrypoint.sh index 3ff3886..bad1c63 100644 --- a/scripts/entrypoint.sh +++ b/scripts/entrypoint.sh @@ -1,21 +1,29 @@ #!/bin/bash set -e +echo "[entrypoint] Starting shrine server..." ./shrine & SHRINE_PID=$! if [ "$SEED" = "true" ]; then + echo "[entrypoint] SEED=true, waiting for server on port ${PORT:-3000}..." RETRIES=0 MAX_RETRIES=30 until bash -c "echo > /dev/tcp/localhost/${PORT:-3000}" 2>/dev/null; do RETRIES=$((RETRIES + 1)) if [ "$RETRIES" -ge "$MAX_RETRIES" ]; then - echo "Server failed to start after ${MAX_RETRIES}s" + echo "[entrypoint] Server failed to start after ${MAX_RETRIES}s" exit 1 fi + echo "[entrypoint] Waiting... ($RETRIES/$MAX_RETRIES)" sleep 1 done + echo "[entrypoint] Server is up, running seed script..." bash scripts/seed.sh + echo "[entrypoint] Seed complete" +else + echo "[entrypoint] SEED not set, skipping seed" fi +echo "[entrypoint] Waiting on server process..." wait $SHRINE_PID
\ No newline at end of file |
