-
Notifications
You must be signed in to change notification settings - Fork 2
chore: automaic CD Pipeline #13
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
Conversation
Walkthrough이 변경사항은 CI/CD 자동화, 도커 배포, 데이터베이스 및 환경설정 개선에 중점을 두고 있습니다. 새로운 GitHub Actions 워크플로우, 여러 Dockerfile 및 Docker Compose 파일이 추가되었으며, 환경 변수 및 데이터베이스 설정이 수정되었습니다. 일부 라이브러리 버전 및 코드 스타일도 변경되었습니다. Changes
Sequence Diagram(s)sequenceDiagram
participant Developer
participant GitHub
participant GitHub Actions
participant RemoteServer
Developer->>GitHub: develop 브랜치에 푸시
GitHub->>GitHub Actions: 워크플로우 트리거
GitHub Actions->>GitHub Actions: 소스코드 체크아웃, JDK 21 세팅, Gradle 빌드
GitHub Actions->>GitHub Actions: Docker 이미지 빌드 및 tar로 저장
GitHub Actions->>GitHub Actions: 아티팩트 zip 압축
GitHub Actions->>RemoteServer: SCP로 zip 파일 전송
GitHub Actions->>RemoteServer: SSH로 배포 명령 실행 (압축 해제, 이미지 로드, docker-compose up)
RemoteServer->>RemoteServer: 서비스 배포 및 실행
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 4
🧹 Nitpick comments (11)
noweekend-mcp/mcp-host/src/main/kotlin/noweekend/mcphost/config/MyAgentState.kt (2)
6-6
: 불필요한 Java 임포트 추가Java Supplier 인터페이스 임포트가 추가되었습니다. Kotlin에서는 람다 표현식이 더 관용적이고 간결합니다.
22-24
: Kotlin 람다 표현식 사용을 권장합니다Java Supplier 인스턴스 대신 Kotlin 람다 표현식을 사용하는 것이 더 간결하고 Kotlin 스타일에 적합합니다.
다음과 같이 원래 Kotlin 람다 표현식을 유지하는 것을 권장합니다:
- "question" to Channels.base(Supplier { "" }), - "chat_response" to Channels.base(Supplier { "" }), - "weather_json" to Channels.base(Supplier { "" }), + "question" to Channels.base { "" }, + "chat_response" to Channels.base { "" }, + "weather_json" to Channels.base { "" },noweekend-mcp/mcp-server/Dockerfile (1)
1-4
: 표준적인 Dockerfile 구조 승인mcp-server 컨테이너화를 위한 Dockerfile이 적절하게 구성되었습니다. Java 21 JRE 베이스 이미지 사용과 표준 패턴을 따르고 있습니다.
프로덕션 환경을 위한 추가 개선 사항을 고려해보세요:
FROM eclipse-temurin:21-jre + +# 보안을 위한 non-root 사용자 생성 +RUN addgroup --system --gid 1001 appgroup && \ + adduser --system --uid 1001 --gid 1001 appuser + WORKDIR /app COPY build/libs/mcp-server-*.jar app.jar + +# 애플리케이션 파일 소유권 변경 +RUN chown appuser:appgroup app.jar + +# non-root 사용자로 전환 +USER appuser + ENTRYPOINT ["java", "-jar", "app.jar"]docker-compose.db.yml (2)
25-27
: 외부 네트워크 선언 확인
mashupnet
을external
로 선언했는데, 해당 네트워크가 사전에 생성되어 있지 않으면 배포가 실패합니다. 배포 스크립트나 가이드에 네트워크 생성 단계를 추가하거나 검증 로직을 포함하세요.🧰 Tools
🪛 YAMLlint (1.37.1)
[error] 27-27: no new line character at the end of file
(new-line-at-end-of-file)
27-27
: 파일 끝에 개행 문자 추가 필요
YAMLLint 경고(new-line-at-end-of-file
)를 해소하려면 마지막 줄에 빈 줄을 추가해주세요.🧰 Tools
🪛 YAMLlint (1.37.1)
[error] 27-27: no new line character at the end of file
(new-line-at-end-of-file)
.github/workflows/cd-app-develop.yml (6)
1-7
: 수동 실행 워크플로우 트리거 추가 고려
현재 on.push 이벤트만 정의되어 있어 특정 브랜치에 푸시될 때만 실행됩니다. 긴급 배포나 테스트용으로 GitHub UI에서 워크플로우를 수동으로 트리거하는workflow_dispatch
이벤트를 추가하는 것을 권장합니다.
16-21
: Gradle 캐시 활성화 권장
actions/setup-java
에서cache: 'gradle'
옵션을 추가해 빌드 속도를 개선할 수 있습니다.🧰 Tools
🪛 actionlint (1.7.7)
17-17: the runner of "actions/setup-java@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
22-24
: Gradle 데몬 옵션 고려
./gradlew
명령에--no-daemon
을 추가해 데몬 실행을 방지하거나,--quiet
플래그로 로그 출력을 줄여 워크플로우 로그를 간소화할 수 있습니다.
25-27
: Docker 이미지 태그 전략 개선
latest
태그 대신 Git 커밋 SHA나 버전 번호를 포함한 태그를 사용하면 배포된 이미지 식별이 용이해집니다.
28-32
: ‘sleep’ 사용 대신 파일 존재 확인
docker save
직후sleep
을 사용하는 대신while
루프와test -f core-api.tar
같은 방식으로 파일 생성 완료를 안전하게 확인하는 것이 더 견고합니다.
61-61
: 파일 끝 newline 추가
YAML 파일의 마지막 줄에 개행 문자를 추가해new-line-at-end-of-file
lint 오류를 해결하세요.🧰 Tools
🪛 YAMLlint (1.37.1)
[error] 61-61: no new line character at the end of file
(new-line-at-end-of-file)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (10)
.github/workflows/cd-app-develop.yml
(1 hunks)docker-compose.app.yml
(1 hunks)docker-compose.db.yml
(1 hunks)noweekend-core/core-api/Dockerfile
(1 hunks)noweekend-core/core-api/src/main/resources/application.yml
(1 hunks)noweekend-core/core-domain/build.gradle.kts
(1 hunks)noweekend-mcp/mcp-host/Dockerfile
(1 hunks)noweekend-mcp/mcp-host/src/main/kotlin/noweekend/mcphost/config/MyAgentState.kt
(2 hunks)noweekend-mcp/mcp-server/Dockerfile
(1 hunks)noweekend-storage/db-core/src/main/resources/db-core.yml
(2 hunks)
🧰 Additional context used
🪛 YAMLlint (1.37.1)
docker-compose.db.yml
[error] 27-27: no new line character at the end of file
(new-line-at-end-of-file)
.github/workflows/cd-app-develop.yml
[error] 61-61: no new line character at the end of file
(new-line-at-end-of-file)
🪛 actionlint (1.7.7)
.github/workflows/cd-app-develop.yml
14-14: the runner of "actions/checkout@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
17-17: the runner of "actions/setup-java@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: build
🔇 Additional comments (10)
noweekend-core/core-api/src/main/resources/application.yml (1)
15-17
: 보안 강화를 위한 Jasypt 설정 추가 승인환경 변수를 통한 Jasypt 암호화 설정 추가는 컨테이너화된 환경에서 민감한 정보를 안전하게 관리하는 좋은 방법입니다.
noweekend-mcp/mcp-host/Dockerfile (1)
1-4
: 베이스 이미지 및 JAR 복사/실행 방식 적절함
eclipse-temurin:21-jre
를 사용해 런타임만 포함하고, 빌드 결과물을app.jar
로 복사 후 실행하도록 구성한 점이 깔끔합니다.noweekend-core/core-api/Dockerfile (1)
1-4
: Core-API Dockerfile 구성 적합
mcp-host와 동일한 패턴으로 Java 21 런타임 기반 컨테이너를 구성했고, 작업 디렉터리 및 entrypoint가 명확합니다.docker-compose.app.yml (1)
8-12
: 환경 변수 주입 방식 검증 필요
JASYPT_ENCRYPTOR_PASSWORD
를 호스트에서 받아오도록 설정했는데, CI/CD 워크플로우나 배포 문서에서 이 변수의 설정 여부를 반드시 확인하도록 안내가 필요합니다..github/workflows/cd-app-develop.yml (6)
9-11
: 런너 환경 설정 확인 완료
runs-on: ubuntu-latest
은 최신 Ubuntu 이미지로 문제 없습니다.
13-15
: 소스 코드 체크아웃 단계 OK
actions/checkout@v3
를 사용해 최신 코드를 정상적으로 가져옵니다.🧰 Tools
🪛 actionlint (1.7.7)
14-14: the runner of "actions/checkout@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
33-35
: 아티팩트 권한 설정 단계 OK
chmod 644
를 사용해 파일 권한을 적절히 설정합니다.
36-38
: 아티팩트 압축 단계 OK
zip
을 이용해 배포 자료를 압축합니다.
39-48
: SCP 액션 설정 OK
appleboy/[email protected]
를 사용해 배포 파일을 원격 서버에 전송합니다.
49-61
: 원격 배포 스크립트 확인
docker compose
명령으로 컨테이너를 실행합니다. 대상 서버에 Docker Compose 플러그인이 설치되어 있는지 확인이 필요합니다.🧰 Tools
🪛 YAMLlint (1.37.1)
[error] 61-61: no new line character at the end of file
(new-line-at-end-of-file)
요약(개요)
api.jar auto CD
작업 내용
집중해서 리뷰해야 하는 부분
기타 전달 사항 및 참고 자료(선택)
Summary by CodeRabbit
신규 기능
설정 및 환경 개선
의존성 변경
코드 스타일