Fix healthcheck when used with base_path
This commit is contained in:
parent
7bae93a04f
commit
e251fba26c
1 changed files with 5 additions and 1 deletions
|
|
@ -2,6 +2,7 @@
|
|||
set -euuo pipefail
|
||||
|
||||
LOCAL_PORT="${YTP_PORT:-8081}"
|
||||
BASE_PATH="${YTP_BASE_PATH:-/}"
|
||||
|
||||
curl_args=(-f)
|
||||
|
||||
|
|
@ -10,5 +11,8 @@ if [[ -n "${YTP_AUTH_USERNAME:-}" && -n "${YTP_AUTH_PASSWORD:-}" ]]; then
|
|||
curl_args+=(-H "Authorization: Basic ${cred}")
|
||||
fi
|
||||
|
||||
curl_args+=("http://localhost:${LOCAL_PORT}/api/ping")
|
||||
# strip trailing slashes from BASE_PATH
|
||||
BASE_PATH=$(echo "${BASE_PATH}" | sed 's:/*$::')
|
||||
|
||||
curl_args+=("http://localhost:${LOCAL_PORT}${BASE_PATH}/api/ping")
|
||||
/usr/bin/curl "${curl_args[@]}"
|
||||
|
|
|
|||
Loading…
Reference in a new issue