catalog-service/bin/entrypoint.sh

40 lines
798 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 3
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
waitForService "api-registry:8500"
waitForService "postgres-db:5432"
# waitForService "db-postgres.service.ego.io:5432"
waitForService "api-eventbus:5672"
# waitForService "esb.service.ego.io:5672"
waitForService "api-logger:24224"
# waitForService "logger.service.ego.io:24224"
# register-service
# run migrations
migrate.sh
# ping wp.pl
# apk add curl
# curl -v http://catalog-svc:80/health?name=catalog
# set -euo pipefail
exec "$@"