pricing-service/bin/entrypoint.sh

33 lines
574 B
Bash
Raw Normal View History

2022-12-17 14:47:58 +01:00
#!/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 3
2022-12-17 14:47:58 +01:00
wait-for-it.sh $1 -t 2 1>/dev/null 2>&1
status=$?
done
}
update-resolv # provided by stack - better approach - single copy
update-ca-certificates
2022-12-17 14:47:58 +01:00
waitForService "api-eventbus:5672"
waitForService "api-logger:24224"
2024-12-05 17:01:27 +01:00
waitForService "api-registry:8501"
waitForService "db-postgres:5432"
register-service
2022-12-17 14:47:58 +01:00
# run migrations
migrate.sh
# set -euo pipefail
exec "$@"