fix(ci): route E2E check requests through public domain to prevent Nginx 404 IP blocks
TaxBaik CI/CD / build-and-deploy (push) Successful in 2m27s
TaxBaik CI/CD / build-and-deploy (push) Successful in 2m27s
This commit is contained in:
@@ -47,16 +47,16 @@ jobs:
|
|||||||
echo "Expected short version: $SHORT_VERSION"
|
echo "Expected short version: $SHORT_VERSION"
|
||||||
for i in $(seq 1 20); do
|
for i in $(seq 1 20); do
|
||||||
# Suppress stderr and allow failures to handle transition/down periods cleanly
|
# Suppress stderr and allow failures to handle transition/down periods cleanly
|
||||||
VERSION_BODY="$(curl -fsS "http://${DEPLOY_HOST}/taxbaik/version.json" 2>/dev/null || true)"
|
VERSION_BODY="$(curl -fsS "https://www.taxbaik.com/taxbaik/version.json" 2>/dev/null || true)"
|
||||||
BLOG_STATUS="$(curl -s -o /dev/null -w '%{http_code}' "http://${DEPLOY_HOST}/taxbaik/blog/accountant-mistakes-5" || true)"
|
BLOG_STATUS="$(curl -s -o /dev/null -w '%{http_code}' "https://www.taxbaik.com/taxbaik/blog/accountant-mistakes-5" || true)"
|
||||||
LOGIN_STATUS="$(curl -s -o /dev/null -w '%{http_code}' "http://${DEPLOY_HOST}/taxbaik/admin/login" || true)"
|
LOGIN_STATUS="$(curl -s -o /dev/null -w '%{http_code}' "https://www.taxbaik.com/taxbaik/admin/login" || true)"
|
||||||
if echo "$VERSION_BODY" | grep -q "\"version\": \"${SHORT_VERSION}\"" && [ "$BLOG_STATUS" = "200" ] && [ "$LOGIN_STATUS" = "200" ]; then
|
if echo "$VERSION_BODY" | grep -q "\"version\": \"${SHORT_VERSION}\"" && [ "$BLOG_STATUS" = "200" ] && [ "$LOGIN_STATUS" = "200" ]; then
|
||||||
echo "✓ Deployment ready for ${SHORT_VERSION} (attempt $i/20)"
|
echo "✓ Deployment ready for ${SHORT_VERSION} (attempt $i/20)"
|
||||||
ROOT_URL="http://${DEPLOY_HOST}/" \
|
ROOT_URL="https://www.taxbaik.com/" \
|
||||||
ADMIN_URL="http://${DEPLOY_HOST}/taxbaik/admin/login" \
|
ADMIN_URL="https://www.taxbaik.com/taxbaik/admin/login" \
|
||||||
PUBLIC_MARKER="백원숙 세무회계" \
|
PUBLIC_MARKER="백원숙 세무회계" \
|
||||||
PUBLIC_FORBIDDEN="관리자" \
|
PUBLIC_FORBIDDEN="관리자" \
|
||||||
ADMIN_MARKER="TaxBaik Admin" \
|
ADMIN_MARKER="관리자 로그인" \
|
||||||
MAX_RETRIES=1 \
|
MAX_RETRIES=1 \
|
||||||
bash ./scripts/taxbaik-smoke.sh
|
bash ./scripts/taxbaik-smoke.sh
|
||||||
exit 0
|
exit 0
|
||||||
@@ -72,43 +72,41 @@ jobs:
|
|||||||
- name: Browser Smoke verification
|
- name: Browser Smoke verification
|
||||||
env:
|
env:
|
||||||
# Green-Blue 배포 지원: Nginx를 통해 active 포트로 라우팅
|
# Green-Blue 배포 지원: Nginx를 통해 active 포트로 라우팅
|
||||||
E2E_BASE_URL: http://${{ secrets.DEPLOY_HOST }}/taxbaik
|
E2E_BASE_URL: https://www.taxbaik.com/taxbaik
|
||||||
# E2E 테스트는 test_admin 테스트 계정 사용 (실 admin 계정과 분리)
|
# E2E 테스트는 test_admin 테스트 계정 사용 (실 admin 계정과 분리)
|
||||||
E2E_ADMIN_USERNAME: test_admin
|
E2E_ADMIN_USERNAME: test_admin
|
||||||
E2E_ADMIN_PASSWORD: TestAdmin@123456
|
E2E_ADMIN_PASSWORD: ${{ secrets.E2E_ADMIN_PASSWORD }}
|
||||||
run: |
|
run: |
|
||||||
echo "Running smoke checks on Desktop Chrome (production verification)"
|
echo "Running smoke checks on Desktop Chrome (production verification)"
|
||||||
npm run test:e2e:public-smoke
|
npm run test:e2e:public-smoke
|
||||||
npm run test:e2e:admin-smoke
|
npm run test:e2e:admin-smoke
|
||||||
echo "Smoke failed: verify public root and /taxbaik/admin/login body markers."
|
|
||||||
|
|
||||||
- name: Browser E2E verification
|
- name: Browser E2E verification
|
||||||
env:
|
env:
|
||||||
# Green-Blue 배포 지원: Nginx를 통해 active 포트로 라우팅
|
# Green-Blue 배포 지원: Nginx를 통해 active 포트로 라우팅
|
||||||
E2E_BASE_URL: http://${{ secrets.DEPLOY_HOST }}/taxbaik
|
E2E_BASE_URL: https://www.taxbaik.com/taxbaik
|
||||||
# E2E 테스트는 test_admin 테스트 계정 사용 (실 admin 계정과 분리)
|
# E2E 테스트는 test_admin 테스트 계정 사용 (실 admin 계정과 분리)
|
||||||
E2E_ADMIN_USERNAME: test_admin
|
E2E_ADMIN_USERNAME: test_admin
|
||||||
E2E_ADMIN_PASSWORD: TestAdmin@123456
|
E2E_ADMIN_PASSWORD: ${{ secrets.E2E_ADMIN_PASSWORD }}
|
||||||
run: |
|
run: |
|
||||||
echo "Running full E2E on Desktop Chrome (production verification)"
|
echo "Running full E2E on Desktop Chrome (production verification)"
|
||||||
npx playwright test --project="Desktop Chrome" --reporter=html --reporter=list
|
npx playwright test --project="Desktop Chrome" --reporter=html --reporter=list
|
||||||
|
|
||||||
- name: API smoke verification
|
- name: API smoke verification
|
||||||
env:
|
env:
|
||||||
DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }}
|
|
||||||
E2E_ADMIN_USERNAME: test_admin
|
E2E_ADMIN_USERNAME: test_admin
|
||||||
E2E_ADMIN_PASSWORD: TestAdmin@123456
|
E2E_ADMIN_PASSWORD: ${{ secrets.E2E_ADMIN_PASSWORD }}
|
||||||
run: |
|
run: |
|
||||||
set -e
|
set -e
|
||||||
TOKEN="$(curl -s -X POST "http://${DEPLOY_HOST}/taxbaik/api/auth/login" -H "Content-Type: application/json" -d "{\"username\":\"${E2E_ADMIN_USERNAME}\",\"password\":\"${E2E_ADMIN_PASSWORD}\"}" | python3 -c 'import sys, json; print(json.load(sys.stdin)["accessToken"])')"
|
TOKEN="$(curl -s -X POST "https://www.taxbaik.com/taxbaik/api/auth/login" -H "Content-Type: application/json" -d "{\"username\":\"${E2E_ADMIN_USERNAME}\",\"password\":\"${E2E_ADMIN_PASSWORD}\"}" | python3 -c 'import sys, json; print(json.load(sys.stdin)["accessToken"])')"
|
||||||
test -n "$TOKEN"
|
test -n "$TOKEN"
|
||||||
curl -fsS -H "Authorization: Bearer $TOKEN" "http://${DEPLOY_HOST}/taxbaik/api/blog/admin?page=1&pageSize=1" >/dev/null
|
curl -fsS -H "Authorization: Bearer $TOKEN" "https://www.taxbaik.com/taxbaik/api/blog/admin?page=1&pageSize=1" >/dev/null
|
||||||
curl -fsS -H "Authorization: Bearer $TOKEN" "http://${DEPLOY_HOST}/taxbaik/api/faq" >/dev/null
|
curl -fsS -H "Authorization: Bearer $TOKEN" "https://www.taxbaik.com/taxbaik/api/faq" >/dev/null
|
||||||
curl -fsS -H "Authorization: Bearer $TOKEN" "http://${DEPLOY_HOST}/taxbaik/api/announcement" >/dev/null
|
curl -fsS -H "Authorization: Bearer $TOKEN" "https://www.taxbaik.com/taxbaik/api/announcement" >/dev/null
|
||||||
curl -fsS -H "Authorization: Bearer $TOKEN" "http://${DEPLOY_HOST}/taxbaik/api/inquiry?page=1&pageSize=1" >/dev/null
|
curl -fsS -H "Authorization: Bearer $TOKEN" "https://www.taxbaik.com/taxbaik/api/inquiry?page=1&pageSize=1" >/dev/null
|
||||||
curl -fsS "http://${DEPLOY_HOST}/taxbaik/favicon.svg" >/dev/null
|
curl -fsS "https://www.taxbaik.com/taxbaik/favicon.svg" >/dev/null
|
||||||
curl -fsS "http://${DEPLOY_HOST}/taxbaik/favicon.ico" >/dev/null
|
curl -fsS "https://www.taxbaik.com/taxbaik/favicon.ico" >/dev/null
|
||||||
curl -fsS "http://${DEPLOY_HOST}/taxbaik/robots.txt" >/dev/null
|
curl -fsS "https://www.taxbaik.com/taxbaik/robots.txt" >/dev/null
|
||||||
|
|
||||||
- name: Browser E2E summary
|
- name: Browser E2E summary
|
||||||
if: always()
|
if: always()
|
||||||
|
|||||||
Reference in New Issue
Block a user