2022-12-07 02:51:47 +01:00
|
|
|
#!/usr/bin/env sh
|
|
|
|
set +e
|
|
|
|
|
|
|
|
waitForService()
|
|
|
|
{
|
2022-12-17 08:26:32 +01:00
|
|
|
wait-for-it.sh $1 -t 2 1>/dev/null 2>&1
|
2022-12-07 02:51:47 +01:00
|
|
|
status=$?
|
|
|
|
while [ $status != 0 ]
|
|
|
|
do
|
|
|
|
echo "[x] wating for $1..."
|
|
|
|
sleep 1
|
2022-12-17 08:26:32 +01:00
|
|
|
wait-for-it.sh $1 -t 2 1>/dev/null 2>&1
|
2022-12-07 02:51:47 +01:00
|
|
|
status=$?
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
2024-07-19 21:27:13 +02:00
|
|
|
update-resolv # provided by stack - better approach - single copy
|
|
|
|
update-ca-certificates
|
|
|
|
|
|
|
|
waitForService "api-registry:8500"
|
2022-12-07 02:51:47 +01:00
|
|
|
waitForService "postgres-db:5432"
|
|
|
|
waitForService "api-eventbus:5672"
|
|
|
|
waitForService "api-logger:24224"
|
2022-12-25 21:06:23 +01:00
|
|
|
waitForService "basket-svc:80"
|
2022-12-07 02:51:47 +01:00
|
|
|
|
2022-12-17 08:26:32 +01:00
|
|
|
# run migrations
|
|
|
|
migrate.sh
|
2022-12-07 02:51:47 +01:00
|
|
|
|
2022-12-17 08:26:32 +01:00
|
|
|
# set -euo pipefail
|
2022-12-07 02:51:47 +01:00
|
|
|
|
|
|
|
exec "$@"
|