fix: allow redirect on public root smoke
TaxBaik CI/CD / build-and-deploy (push) Failing after 4m36s
TaxBaik CI/CD / build-and-deploy (push) Failing after 4m36s
This commit is contained in:
@@ -349,9 +349,15 @@ jobs:
|
|||||||
# 실제 사용자가 접속하는 경로 그대로 외부에서 검증해야 이런 장애를 CI가 스스로 잡는다.
|
# 실제 사용자가 접속하는 경로 그대로 외부에서 검증해야 이런 장애를 CI가 스스로 잡는다.
|
||||||
check_public() {
|
check_public() {
|
||||||
local url="$1"
|
local url="$1"
|
||||||
|
local allow_redirect="${2:-0}"
|
||||||
local status
|
local status
|
||||||
status=$(curl -fsSL -o /dev/null -w '%{http_code}' --max-time 15 "$url" || echo "000")
|
status=$(curl -s -o /dev/null -w '%{http_code}' --max-time 15 "$url" || echo "000")
|
||||||
if [ "$status" != "200" ]; then
|
if [ "$allow_redirect" = "1" ]; then
|
||||||
|
if ! printf '%s' "$status" | grep -Eq '^(200|301|302|307|308)$'; then
|
||||||
|
echo " ✗ $url → HTTP $status" >&2
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
elif [ "$status" != "200" ]; then
|
||||||
echo " ✗ $url → HTTP $status" >&2
|
echo " ✗ $url → HTTP $status" >&2
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
@@ -362,7 +368,7 @@ jobs:
|
|||||||
echo "--- 실제 공개 도메인 종단 간 검증 (Nginx/Cloudflare 경유, 최대 3회 재시도) ---"
|
echo "--- 실제 공개 도메인 종단 간 검증 (Nginx/Cloudflare 경유, 최대 3회 재시도) ---"
|
||||||
PUBLIC_OK=false
|
PUBLIC_OK=false
|
||||||
for i in 1 2 3; do
|
for i in 1 2 3; do
|
||||||
if check_public "https://www.taxbaik.com/" \
|
if check_public "https://www.taxbaik.com/" 1 \
|
||||||
&& check_public "https://www.taxbaik.com/taxbaik/" \
|
&& check_public "https://www.taxbaik.com/taxbaik/" \
|
||||||
&& check_public "https://www.taxbaik.com/taxbaik/admin/login"; then
|
&& check_public "https://www.taxbaik.com/taxbaik/admin/login"; then
|
||||||
PUBLIC_OK=true
|
PUBLIC_OK=true
|
||||||
|
|||||||
Reference in New Issue
Block a user