Skip to content

Commit e5d1d27

Browse files
committed
Merge branch 'feat/#30' into release
2 parents 7c6cd83 + 6b482fc commit e5d1d27

2 files changed

Lines changed: 23 additions & 16 deletions

File tree

.github/workflows/cd.yml

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,13 @@ jobs:
3737
set -e
3838
cd ~/deploy
3939
40-
echo "🔍 Detecting active container..."
40+
echo "🔍 Reading active slot..."
41+
ACTIVE=$(cat active-slot.txt)
4142
42-
if docker ps --filter "name=concert-spring-blue" --format "{{.Status}}" | grep -q healthy; then
43-
ACTIVE=blue
43+
if [ "$ACTIVE" = "blue" ]; then
4444
TARGET=green
4545
PORT=8082
4646
else
47-
ACTIVE=green
4847
TARGET=blue
4948
PORT=8081
5049
fi
@@ -68,12 +67,20 @@ jobs:
6867
echo "⏳ still waiting..."
6968
sleep 5
7069
done
71-
72-
if [ "$HEALTHY" = "true" ]; then
73-
echo "✅ spring-$TARGET is healthy"
74-
exit 0
70+
71+
if [ "$HEALTHY" != "true" ]; then
72+
echo "❌ Health check failed for spring-$TARGET - rolling back"
73+
docker compose -f docker-compose-prod.yml stop spring-$TARGET
74+
exit 1
7575
fi
76-
77-
echo "❌ Health check failed for spring-$TARGET - rolling back"
78-
docker compose -f docker-compose-prod.yml stop spring-$TARGET
79-
exit 1
76+
77+
echo "✅ spring-$TARGET is healthy"
78+
79+
echo "🔀 (MANUAL) Switch NPM forward port to $PORT"
80+
echo "✍️ Update active slot"
81+
echo "$TARGET" > active-slot.txt
82+
83+
echo "🛑 Stop old container: spring-$ACTIVE"
84+
docker compose -f docker-compose-prod.yml stop spring-$ACTIVE
85+
86+
echo "🎉 Blue/Green deployment completed"

src/main/java/com/back/web7_9_codecrete_be/domain/location/controller/KakaoApiController.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,28 +42,28 @@ public class KakaoApiController {
4242
@Operation(
4343
summary = "주변 음식점 조회",
4444
description = "좌표(서울 시청 근처)로 카카오 로컬에서 주변 음식점을 조회합니다, 좌표는 입력하면 됩니다." +
45-
"예시 : http://localhost:8080/api/v1/location/kakao/restaurant?lat=37.5665&lon=126.9780"
45+
"예시 : http://localhost:8080/api/v1/location/kakao/restaurant?x=37.5665&y=126.9780"
4646
)
4747
@PostMapping("/restaurant")
4848
public List<KakaoLocalResponse.Document> KakaoRestaurants(
4949
@RequestParam double x,
5050
@RequestParam double y
5151
) {
52-
return kakaoLocalService.searchNearbyRestaurants(x, y);
52+
return kakaoLocalService.searchNearbyRestaurants(y, x);
5353
}
5454

5555

5656
@Operation(
5757
summary = "주변 카페 조회",
5858
description = "좌표(서울 시청 근처)로 카카오 로컬에서 주변 카페를 조회합니다, 좌표는 입력하면 됩니다." +
59-
"예시 : http://localhost:8080/api/v1/location/kakao/cafes?lat=37.5665&lon=126.9780"
59+
"예시 : http://localhost:8080/api/v1/location/kakao/cafes?x=37.5665&y=126.9780"
6060
)
6161
@PostMapping("/cafes")
6262
public List<KakaoLocalResponse.Document> KakaoCafes(
6363
@RequestParam double x,
6464
@RequestParam double y
6565
) {
66-
return kakaoLocalService.searchNearbyCafes(x, y);
66+
return kakaoLocalService.searchNearbyCafes(y, x);
6767
}
6868

6969

0 commit comments

Comments
 (0)