mirror of
https://github.com/immich-app/yucca.git
synced 2026-09-30 13:33:00 +08:00
31 lines
931 B
Bash
Executable File
31 lines
931 B
Bash
Executable File
#!/usr/bin/env bash
|
|
#MISE description="Wait for development environment to be ready"
|
|
# Targets the compose/`mise dev` flow (the k3d flow has its own readiness
|
|
# handling in packages/e2e/k3d/run.sh and does not use this task).
|
|
set -e
|
|
source "$(dirname "$0")/../../michael/env"
|
|
source "$(dirname "$0")/../../yucca-api/env"
|
|
|
|
echo Ensure dev environment is running before invoking tests.
|
|
|
|
wait_for_port() {
|
|
local port="$1"
|
|
local name="$2"
|
|
local timeout="${3:-60}"
|
|
local elapsed=0
|
|
while ! nc -z localhost "$port" 2>/dev/null; do
|
|
if [ "$elapsed" -ge "$timeout" ]; then
|
|
echo "timed out waiting for $name (localhost:$port) after ${timeout}s" >&2
|
|
return 1
|
|
fi
|
|
sleep 0.5
|
|
elapsed=$((elapsed + 1))
|
|
done
|
|
}
|
|
|
|
wait_for_port 8092 mock-oidc-provider
|
|
wait_for_port "$RESTIC_API_PORT" michael
|
|
wait_for_port "$YUCCA_API_PORT" yucca-api
|
|
wait_for_port 22676 orchestration-api
|
|
wait_for_port "${WEB_PORT:-36033}" web
|