Skip to content

Commit d30ac5f

Browse files
committed
chore: CI 용 헬스체크 API 추가
1 parent dac7352 commit d30ac5f

3 files changed

Lines changed: 20 additions & 2 deletions

File tree

.github/workflows/backend-deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ jobs:
106106
107107
# 스모크 테스트
108108
sleep 5
109-
curl -f http://localhost:8080/actuator/health || {
109+
curl -f http://localhost:8080/internal/healthz || {
110110
echo "Health check failed. Rolling back..."
111111
mv -f /home/ec2-user/maru-backend.jar.bak /home/ec2-user/maru-backend.jar || true
112112
sudo systemctl restart maru-backend

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Excepti
5454
"/api/v1/sms/**",
5555
"/api/v1/dev/**", // TODO: 테스트용. 프로덕션에서는 반드시 삭제할 것.
5656
"/api/v1/dojangs/**", // TODO: 테스트용. 프로덕션에서는 반드시 삭제할 것.
57-
"/actuator/health",
57+
"/internal/healthz",
5858
"/favicon.ico",
5959
"/error"
6060
).permitAll()
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package com.maru.controller.internal;
2+
3+
import org.springframework.web.bind.annotation.GetMapping;
4+
import org.springframework.web.bind.annotation.RestController;
5+
6+
@RestController
7+
public class HealthzController {
8+
9+
/**
10+
* health 체크
11+
*
12+
* @return 응답
13+
*/
14+
@GetMapping("/internal/healthz")
15+
public String healthz() {
16+
return "OK";
17+
}
18+
}

0 commit comments

Comments
 (0)