basket-service/bin/entrypoint.sh
2024-12-05 16:56:54 +01:00

37 lines
756 B
Bash
Executable File

#!/usr/bin/env sh
set +e
waitForService()
{
wait-for-it.sh $1 -t 2 1>/dev/null 2>&1
status=$?
while [ $status != 0 ]
do
echo "[x] wating for $1..."
sleep 1
wait-for-it.sh $1 -t 2 1>/dev/null 2>&1
status=$?
done
}
update-resolv
update-ca-certificates
waitForService "api-registry:8501"
waitForService "esb.service.ego.io:5672"
waitForService "logger.service.ego.io:24224"
waitForService "postgresdb.service.ego.io:5432"
# waitForService "pricing.service.ego.io:443"
# waitForService "api-eventbus:5672"
# waitForService "api-logger:24224"
# waitForService "db-postgres:5432"
# waitForService "pricing-svc:443" #dev-disabled
register-service
# run migrations
migrate.sh
# set -euo pipefail
exec "$@"