-
Notifications
You must be signed in to change notification settings - Fork 1
[feat] 웨이블존 추천, 검색 응답 필드에 장애 시설 정보 추가 #65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
8ce0faf
45aa645
3a6af0d
469de36
5d74fb2
5243f3f
00f1bb1
841ccac
9467274
9a17da3
47b220e
350df6c
f33972f
49aac1a
7faeda1
8b70d24
6d9e14c
f40f4fb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -49,18 +49,56 @@ jobs: | |||||||||||||||||
| - name: Pull latest image from Docker Hub | ||||||||||||||||||
| run: sudo docker pull ${{ secrets.DOCKERHUB_USERNAME }}/github-actions-demo:latest | ||||||||||||||||||
|
|
||||||||||||||||||
| - name: Stop existing container if any | ||||||||||||||||||
| - name: Stop existing containers if any | ||||||||||||||||||
| run: | | ||||||||||||||||||
| CONTAINER_ID=$(sudo docker ps -q --filter "name=github-actions-demo") | ||||||||||||||||||
| if [ ! -z "$CONTAINER_ID" ]; then | ||||||||||||||||||
| sudo docker stop $CONTAINER_ID | ||||||||||||||||||
| # Stop Spring Boot app container | ||||||||||||||||||
| APP_CONTAINER_ID=$(sudo docker ps -q --filter "name=github-actions-demo") | ||||||||||||||||||
| if [ ! -z "$APP_CONTAINER_ID" ]; then | ||||||||||||||||||
| sudo docker stop $APP_CONTAINER_ID | ||||||||||||||||||
| fi | ||||||||||||||||||
|
|
||||||||||||||||||
| # Stop Elasticsearch container | ||||||||||||||||||
| ES_CONTAINER_ID=$(sudo docker ps -q --filter "name=elasticsearch") | ||||||||||||||||||
| if [ ! -z "$ES_CONTAINER_ID" ]; then | ||||||||||||||||||
| sudo docker stop $ES_CONTAINER_ID | ||||||||||||||||||
| fi | ||||||||||||||||||
|
|
||||||||||||||||||
| - name: Create Docker network if not exists | ||||||||||||||||||
| run: | | ||||||||||||||||||
| sudo docker network create wayble-network || true | ||||||||||||||||||
|
|
||||||||||||||||||
| - name: Run new container | ||||||||||||||||||
| - name: Run Elasticsearch container | ||||||||||||||||||
| run: | | ||||||||||||||||||
| sudo docker run -d \ | ||||||||||||||||||
| --name elasticsearch \ | ||||||||||||||||||
| --network wayble-network \ | ||||||||||||||||||
| -p 9200:9200 -p 9300:9300 \ | ||||||||||||||||||
| -e "discovery.type=single-node" \ | ||||||||||||||||||
| -e "xpack.security.enabled=false" \ | ||||||||||||||||||
| -e "ES_JAVA_OPTS=-Xms512m -Xmx512m" \ | ||||||||||||||||||
| --restart unless-stopped \ | ||||||||||||||||||
| docker.elastic.co/elasticsearch/elasticsearch:9.0.2 | ||||||||||||||||||
|
|
||||||||||||||||||
| - name: Wait for Elasticsearch to be ready | ||||||||||||||||||
| run: | | ||||||||||||||||||
| echo "Waiting for Elasticsearch to start..." | ||||||||||||||||||
| for i in {1..30}; do | ||||||||||||||||||
| if curl -s http://localhost:9200/_health > /dev/null 2>&1; then | ||||||||||||||||||
| echo "Elasticsearch is ready!" | ||||||||||||||||||
| break | ||||||||||||||||||
|
Comment on lines
+85
to
+88
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Elasticsearch 헬스 체크 엔드포인트 오류 - if curl -s http://localhost:9200/_health > /dev/null 2>&1; then
+ if curl -s http://localhost:9200/_cluster/health > /dev/null 2>&1; then📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||
| fi | ||||||||||||||||||
| echo "Waiting... ($i/30)" | ||||||||||||||||||
| sleep 10 | ||||||||||||||||||
| done | ||||||||||||||||||
|
|
||||||||||||||||||
| - name: Run new Spring Boot container | ||||||||||||||||||
| run: | | ||||||||||||||||||
| sudo docker run -d --rm \ | ||||||||||||||||||
| --name github-actions-demo \ | ||||||||||||||||||
| --network wayble-network \ | ||||||||||||||||||
| -p 8080:8080 \ | ||||||||||||||||||
| -e "ELASTICSEARCH_HOST=elasticsearch" \ | ||||||||||||||||||
| -e "ELASTICSEARCH_PORT=9200" \ | ||||||||||||||||||
| ${{ secrets.DOCKERHUB_USERNAME }}/github-actions-demo:latest | ||||||||||||||||||
|
|
||||||||||||||||||
| - name: Prune unused docker resources | ||||||||||||||||||
|
|
||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,153 @@ | ||
| name: Test Elasticsearch CI/CD | ||
|
|
||
| on: | ||
| workflow_dispatch: # 수동 실행 전용 | ||
| push: | ||
| branches: [ "feature/seungmin" ] # 본인 브랜치에서만 실행 | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| # 1. 도커 이미지 빌드 및 푸시 | ||
| build-docker-image: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v3 | ||
|
|
||
| - name: Set up JDK 17 | ||
| uses: actions/setup-java@v3 | ||
| with: | ||
| java-version: '17' | ||
| distribution: 'temurin' | ||
|
|
||
| - name: Build with Gradle | ||
| uses: gradle/gradle-build-action@v2 | ||
| with: | ||
| arguments: clean bootJar | ||
|
|
||
| - name: Docker build with test tag | ||
| run: docker build -t ${{ secrets.DOCKERHUB_USERNAME }}/wayble-test:latest . | ||
|
|
||
| - name: Docker login | ||
| uses: docker/login-action@v2 | ||
| with: | ||
| username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
| password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }} | ||
|
|
||
| - name: Push Docker image | ||
| run: docker push ${{ secrets.DOCKERHUB_USERNAME }}/wayble-test:latest | ||
|
|
||
| # 2. EC2에서 테스트 컨테이너 실행 | ||
| test-elasticsearch-on-ec2: | ||
| needs: build-docker-image | ||
| runs-on: self-hosted | ||
|
|
||
| steps: | ||
| - name: Pull latest test image from Docker Hub | ||
| run: sudo docker pull ${{ secrets.DOCKERHUB_USERNAME }}/wayble-test:latest | ||
|
|
||
| - name: Stop existing test containers if any | ||
| run: | | ||
| # Stop test app container | ||
| TEST_APP_CONTAINER_ID=$(sudo docker ps -q --filter "name=wayble-test-app") | ||
| if [ ! -z "$TEST_APP_CONTAINER_ID" ]; then | ||
| sudo docker stop $TEST_APP_CONTAINER_ID | ||
| sudo docker rm $TEST_APP_CONTAINER_ID | ||
| fi | ||
|
|
||
| # Stop test Elasticsearch container | ||
| TEST_ES_CONTAINER_ID=$(sudo docker ps -q --filter "name=elasticsearch-test") | ||
| if [ ! -z "$TEST_ES_CONTAINER_ID" ]; then | ||
| sudo docker stop $TEST_ES_CONTAINER_ID | ||
| sudo docker rm $TEST_ES_CONTAINER_ID | ||
| fi | ||
|
|
||
| - name: Create test Docker network if not exists | ||
| run: | | ||
| sudo docker network create wayble-test-network || true | ||
|
|
||
| - name: Run test Elasticsearch container | ||
| run: | | ||
| sudo docker run -d \ | ||
| --name elasticsearch-test \ | ||
| --network wayble-test-network \ | ||
| -p 9201:9200 -p 9301:9300 \ | ||
| -e "discovery.type=single-node" \ | ||
| -e "xpack.security.enabled=false" \ | ||
| -e "ES_JAVA_OPTS=-Xms512m -Xmx512m" \ | ||
| docker.elastic.co/elasticsearch/elasticsearch:9.0.2 | ||
|
|
||
| - name: Wait for test Elasticsearch to be ready | ||
| run: | | ||
| echo "Waiting for test Elasticsearch to start..." | ||
| for i in {1..30}; do | ||
| if curl -s http://localhost:9201/_cluster/health > /dev/null 2>&1; then | ||
| echo "Test Elasticsearch is ready!" | ||
| break | ||
| fi | ||
| echo "Waiting... ($i/30)" | ||
| sleep 10 | ||
| done | ||
|
|
||
| - name: Run test Spring Boot container | ||
| run: | | ||
| sudo docker run -d \ | ||
| --name wayble-test-app \ | ||
| --network wayble-test-network \ | ||
| -p 8081:8080 \ | ||
| -e "ELASTICSEARCH_HOST=elasticsearch-test" \ | ||
| -e "ELASTICSEARCH_PORT=9200" \ | ||
| -e "SPRING_PROFILES_ACTIVE=develop" \ | ||
| ${{ secrets.DOCKERHUB_USERNAME }}/wayble-test:latest | ||
|
|
||
| - name: Test application health | ||
| run: | | ||
| echo "Waiting for application to start..." | ||
| sleep 30 | ||
|
|
||
| # 애플리케이션 헬스체크 | ||
| if curl -f http://localhost:8081/actuator/health > /dev/null 2>&1; then | ||
| echo "✅ Application is healthy!" | ||
| else | ||
| echo "❌ Application health check failed" | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Elasticsearch 연결 테스트 | ||
| if curl -f http://localhost:9201/_cluster/health > /dev/null 2>&1; then | ||
| echo "✅ Elasticsearch is accessible!" | ||
| else | ||
| echo "❌ Elasticsearch connection failed" | ||
| exit 1 | ||
| fi | ||
|
|
||
| - name: Cleanup test containers | ||
| if: always() # 성공/실패 관계없이 항상 실행 | ||
| run: | | ||
| # 테스트 컨테이너들 정리 | ||
| sudo docker stop wayble-test-app elasticsearch-test || true | ||
| sudo docker rm wayble-test-app elasticsearch-test || true | ||
| sudo docker network rm wayble-test-network || true | ||
|
|
||
| - name: Prune unused docker resources | ||
| run: sudo docker system prune -f | ||
|
|
||
| # ✅ 테스트 성공 알림 | ||
| - name: Send test success notification | ||
| if: success() | ||
| run: | | ||
| curl -H "Content-Type: application/json" \ | ||
| -X POST \ | ||
| -d "{\"content\": \"✅ Elasticsearch CI/CD 테스트 성공! 이제 develop에 머지해도 안전합니다.\"}" \ | ||
| ${{ secrets.DISCORD_WEBHOOK_URL }} | ||
|
|
||
| # ❌ 테스트 실패 알림 | ||
| - name: Send test failure notification | ||
| if: failure() | ||
| run: | | ||
| curl -H "Content-Type: application/json" \ | ||
| -X POST \ | ||
| -d "{\"content\": \"❌ Elasticsearch CI/CD 테스트 실패! develop 머지 전에 수정이 필요합니다.\"}" \ | ||
| ${{ secrets.DISCORD_WEBHOOK_URL }} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -35,6 +35,8 @@ dependencies { | |
| implementation 'org.springframework.boot:spring-boot-starter-security' | ||
| implementation 'io.jsonwebtoken:jjwt-api:0.11.5' | ||
| implementation 'jakarta.servlet:jakarta.servlet-api:6.0.0' | ||
| implementation 'com.amazonaws:aws-java-sdk-core:1.12.698' | ||
| implementation 'com.amazonaws:aws-java-sdk-s3:1.12.698' | ||
|
Comment on lines
+38
to
+39
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 중복된 AWS SDK 의존성을 제거해주세요. AWS SDK 의존성이 두 번 선언되어 있습니다:
이런 중복 선언은 빌드 설정의 혼란을 야기할 수 있습니다. 다음과 같이 중복을 제거해주세요: implementation 'jakarta.servlet:jakarta.servlet-api:6.0.0'
- implementation 'com.amazonaws:aws-java-sdk-core:1.12.698'
- implementation 'com.amazonaws:aws-java-sdk-s3:1.12.698'
runtimeOnly 'io.jsonwebtoken:jjwt-impl:0.11.5'
runtimeOnly 'io.jsonwebtoken:jjwt-jackson:0.11.5'
runtimeOnly 'com.mysql:mysql-connector-j'
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
//AWS S3
implementation 'com.amazonaws:aws-java-sdk-core:1.12.698'
implementation 'com.amazonaws:aws-java-sdk-s3:1.12.698'Also applies to: 48-49 🤖 Prompt for AI Agents |
||
| runtimeOnly 'io.jsonwebtoken:jjwt-impl:0.11.5' | ||
| runtimeOnly 'io.jsonwebtoken:jjwt-jackson:0.11.5' | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| version: '3.8' | ||
|
|
||
| services: | ||
| # Spring Boot 애플리케이션 (테스트용) | ||
| app-test: | ||
| build: | ||
| context: . | ||
| dockerfile: Dockerfile | ||
| container_name: wayble-app-test | ||
| ports: | ||
| - "8081:8080" # 다른 포트 사용 | ||
| environment: | ||
| - SPRING_PROFILES_ACTIVE=develop | ||
| - ELASTICSEARCH_HOST=elasticsearch-test | ||
| - ELASTICSEARCH_PORT=9200 | ||
| depends_on: | ||
| - elasticsearch-test | ||
| networks: | ||
| - test-network | ||
|
|
||
| # Elasticsearch (테스트용) | ||
| elasticsearch-test: | ||
| build: | ||
| context: . | ||
| dockerfile: Dockerfile.elasticsearch | ||
| container_name: elasticsearch-test | ||
| environment: | ||
| - discovery.type=single-node | ||
| - xpack.security.enabled=false | ||
| - ES_JAVA_OPTS=-Xms512m -Xmx512m | ||
| ports: | ||
| - "9201:9200" # 다른 포트 사용 | ||
| - "9301:9300" | ||
| volumes: | ||
| - es-test-data:/usr/share/elasticsearch/data | ||
| networks: | ||
| - test-network | ||
|
|
||
| networks: | ||
| test-network: | ||
| driver: bridge | ||
|
|
||
| volumes: | ||
| es-test-data: | ||
| driver: local |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| version: '3.8' | ||
|
|
||
| services: | ||
| # Spring Boot 애플리케이션 | ||
| app: | ||
| build: | ||
| context: . | ||
| dockerfile: Dockerfile | ||
| container_name: wayble-app | ||
| restart: unless-stopped | ||
| ports: | ||
| - "8080:8080" | ||
| environment: | ||
| - SPRING_PROFILES_ACTIVE=develop | ||
| - ELASTICSEARCH_HOST=elasticsearch | ||
| - ELASTICSEARCH_PORT=9200 | ||
| depends_on: | ||
| - elasticsearch | ||
| networks: | ||
| - app-network | ||
|
|
||
| # Elasticsearch | ||
| elasticsearch: | ||
| build: | ||
| context: . | ||
| dockerfile: Dockerfile.elasticsearch | ||
| container_name: elasticsearch | ||
| image: es-with-nori:9.0.2 | ||
| restart: unless-stopped | ||
| environment: | ||
| - discovery.type=single-node | ||
| - xpack.security.enabled=false | ||
| - ES_JAVA_OPTS=-Xms512m -Xmx512m | ||
| ports: | ||
| - "9200:9200" | ||
| - "9300:9300" | ||
| volumes: | ||
| - esdata:/usr/share/elasticsearch/data | ||
| networks: | ||
| - app-network | ||
|
|
||
| networks: | ||
| app-network: | ||
| driver: bridge | ||
|
|
||
| volumes: | ||
| esdata: | ||
| driver: local |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,7 +21,7 @@ public class WaybleZoneSearchController { | |
|
|
||
| private final WaybleZoneSearchService waybleZoneSearchService; | ||
|
|
||
| @GetMapping("") | ||
| @GetMapping("/maps") | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chain엔드포인트 경로 변경이 적절하게 구현되었습니다. 검색 API의 경로를 기존 클라이언트나 테스트 코드에서 이 엔드포인트를 호출하는 부분이 있는지 확인해주세요: 🏁 Script executed: #!/bin/bash
# 기존 엔드포인트 경로 사용 확인
echo "=== 테스트 코드에서 기존 경로 사용 확인 ==="
rg -A 3 -B 3 "/api/v1/wayble-zones/search\"" src/test/
echo "=== 전체 프로젝트에서 웨이블존 검색 API 호출 확인 ==="
rg -A 3 -B 3 "wayble-zones/search" --type java
echo "=== 새로운 /maps 경로 사용 확인 ==="
rg -A 3 -B 3 "search/maps" --type javaLength of output: 2563 REST 엔드포인트 경로 변경으로 인한 테스트 수정 필요 컨트롤러에서 엔드포인트를
위 수정 외에도 실제 클라이언트 호출이나 다른 테스트에서 구 경로를 참조하는 부분이 없는지 한번 더 검토 부탁드립니다. 🤖 Prompt for AI Agents |
||
| public CommonResponse<SearchSliceDto<WaybleZoneSearchResponseDto>> findByCondition( | ||
| @Valid @ModelAttribute WaybleZoneSearchConditionDto conditionDto, | ||
| @RequestParam(name = "page", defaultValue = "0") int page, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| package com.wayble.server.explore.dto; | ||
|
|
||
| import com.wayble.server.explore.entity.EsWaybleZoneFacility; | ||
| import lombok.Builder; | ||
|
|
||
| @Builder | ||
| public record FacilityResponseDto( | ||
| Boolean hasSlope, | ||
| Boolean hasNoDoorStep, | ||
| Boolean hasElevator, | ||
| Boolean hasTableSeat, | ||
| Boolean hasDisabledToilet, | ||
| String floorInfo | ||
| ) { | ||
| public static FacilityResponseDto from(EsWaybleZoneFacility facility) { | ||
| if (facility == null) { | ||
| return null; | ||
| } | ||
|
|
||
| return FacilityResponseDto.builder() | ||
| .hasSlope(facility.isHasSlope()) | ||
| .hasNoDoorStep(facility.isHasNoDoorStep()) | ||
| .hasElevator(facility.isHasElevator()) | ||
| .hasTableSeat(facility.isHasTableSeat()) | ||
| .hasDisabledToilet(facility.isHasDisabledToilet()) | ||
| .floorInfo(facility.getFloorInfo()) | ||
| .build(); | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
컨테이너
stop후rm누락 – 동일한 이름으로 새 컨테이너 실행 시 충돌docker stop만 호출하면 컨테이너 이름이 여전히 예약돼 있어 이후docker run --name …단계에서Conflict. The container name … is already in use오류가 발생합니다.docker rm까지 수행해 이름을 해제해 주세요.📝 Committable suggestion
🧰 Tools
🪛 YAMLlint (1.37.1)
[error] 59-59: trailing spaces
(trailing-spaces)
🤖 Prompt for AI Agents