Skip to content

Commit 07b71a4

Browse files
committed
fix: 스모크 테스트 대기시간 수정
1 parent d30ac5f commit 07b71a4

2 files changed

Lines changed: 20 additions & 10 deletions

File tree

.github/workflows/backend-deploy.yml

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -104,13 +104,22 @@ jobs:
104104
# 서비스 재시작
105105
sudo systemctl restart maru-backend
106106
107-
# 스모크 테스트
108-
sleep 5
109-
curl -f http://localhost:8080/internal/healthz || {
110-
echo "Health check failed. Rolling back..."
111-
mv -f /home/ec2-user/maru-backend.jar.bak /home/ec2-user/maru-backend.jar || true
112-
sudo systemctl restart maru-backend
113-
echo "Rollback complete. Service status:"
114-
sudo systemctl status maru-backend --no-pager
115-
exit 1
116-
}
107+
# 스모크 테스트 (최대 60초 대기, 5초 간격 재시도)
108+
echo "Waiting for application to start..."
109+
for i in {1..12}; do
110+
sleep 5
111+
if curl -sf http://localhost:8080/internal/healthz > /dev/null 2>&1; then
112+
echo "Health check passed on attempt $i"
113+
exit 0
114+
fi
115+
echo "Attempt $i/12: Application not ready yet..."
116+
done
117+
118+
# 60초 후에도 실패하면 롤백
119+
echo "Health check failed after 60 seconds. Rolling back..."
120+
mv -f /home/ec2-user/maru-backend.jar.bak /home/ec2-user/maru-backend.jar || true
121+
sudo systemctl restart maru-backend
122+
echo "Rollback complete. Service status:"
123+
sudo systemctl status maru-backend --no-pager
124+
journalctl -u maru-backend -n 50 --no-pager
125+
exit 1

backend/src/main/java/com/maru/config/SecurityConfig.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Excepti
5555
"/api/v1/dev/**", // TODO: 테스트용. 프로덕션에서는 반드시 삭제할 것.
5656
"/api/v1/dojangs/**", // TODO: 테스트용. 프로덕션에서는 반드시 삭제할 것.
5757
"/internal/healthz",
58+
"/actuator/health",
5859
"/favicon.ico",
5960
"/error"
6061
).permitAll()

0 commit comments

Comments
 (0)