-
Notifications
You must be signed in to change notification settings - Fork 8
chore: 문서, 스크립트 파일들 폴더 변경 #390
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
chore: 문서, 스크립트 파일들 폴더 변경 #390
Conversation
Walkthrough
✨ 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: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
docs/script/local_compose_down.sh(1 hunks)docs/script/local_compose_up.sh(1 hunks)
whqtker
left a comment
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.
확인했습니다 !
lsy1307
left a comment
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.
고생하셨어요!
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: 2
🧹 Nitpick comments (2)
docs/script/local_compose_up.sh (2)
8-16: ② 디렉터리 확인·생성을 반복 대신 루프로 DRY 하세요.1. 동일한 패턴의 코드가 두 번 반복됩니다. 2. 배열과 `for` 루프를 이용하면 유지보수가 간결해집니다.-if [ ! -d "${BASE_DIR}/mysql_data_local" ]; then - echo "mysql_data_local 디렉토리가 없습니다. ${BASE_DIR}/mysql_data_local 디렉토리를 생성합니다." - mkdir -p "${BASE_DIR}/mysql_data_local" -fi - -if [ ! -d "${BASE_DIR}/redis_data_local" ]; then - echo "redis_data_local 디렉토리가 없습니다. ${BASE_DIR}/redis_data_local 디렉토리를 생성합니다." - mkdir -p "${BASE_DIR}/redis_data_local" -fi +for dir in mysql_data_local redis_data_local; do + target="${BASE_DIR}/${dir}" + if [ ! -d "${target}" ]; then + echo "${dir} 디렉토리가 없습니다. ${target} 을(를) 생성합니다." + mkdir -p "${target}" + fi +done
21-22: ④ 자동 이미지 정리(Prune) 전 사용자의 확인을 받는 것이 안전합니다.1. `docker image prune -f` 는 태그되지 않은 이미지뿐 아니라 재사용 가능한 캐시까지 삭제해 후속 빌드가 느려질 수 있습니다. 2. 개발‧CI 환경별로 정책이 다를 수 있으니, 프롬프트 또는 환경 변수 플래그(예: `SKIP_PRUNE`)로 제어할 수 있게 하는 방안을 고려해보세요.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
docs/script/local_compose_down.sh(1 hunks)docs/script/local_compose_up.sh(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- docs/script/local_compose_down.sh
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build
🔇 Additional comments (1)
docs/script/local_compose_up.sh (1)
6-6: ⑤BASE_DIR계산 로직 👍- `$(dirname "$0")/../..` 로 두 단계 상위 절대경로를 안전하게 가져오는 구현이 깔끔합니다. - 이후 스크립트 전반에 일관된 기준 경로를 제공해 가독성과 유지보수성이 향상되었습니다.
| # 명령이 0이 아닌 종료값을 가질때 즉시 종료 | ||
| set -e |
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.
🛠️ Refactor suggestion
① set 옵션을 강화해 스크립트 안전성을 높여주세요.
1. `set -e` 만으로는 정의되지 않은 변수를 참조하거나 파이프라인 중간 단계에서 오류가 나도 무시될 수 있습니다.
2. `set -u -o pipefail` 을 함께 설정하면 예기치 못한 런타임 오류를 초기에 포착할 수 있어 운영 중단 가능성을 낮춥니다.
-set -e
+set -euo pipefail📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| # 명령이 0이 아닌 종료값을 가질때 즉시 종료 | |
| set -e | |
| # 명령이 0이 아닌 종료값을 가질때 즉시 종료 | |
| -set -e | |
| +set -euo pipefail |
🤖 Prompt for AI Agents
In docs/script/local_compose_up.sh at lines 3 to 4, the script currently uses
only 'set -e' which does not catch undefined variable references or errors in
intermediate pipeline commands. To improve script safety, add 'set -u' to treat
unset variables as errors and 'set -o pipefail' to ensure the script fails if
any command in a pipeline fails. Update the set command to 'set -euo pipefail'
to enable all these options together.
| fi | ||
|
|
||
| echo "Starting all docker containers..." | ||
| docker compose -f "${BASE_DIR}/docker-compose.local.yml" up -d |
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.
🛠️ Refactor suggestion
③ docker-compose.local.yml 존재 여부를 선검사해 예외 처리하세요.
1. 파일이 없을 경우 `docker compose` 는 불친절한 스택 트레이스를 남기고 종료합니다.
2. 실행 전 파일 존재를 확인해 명확한 오류 메시지를 주면 디버깅 비용이 줄어듭니다.
+if [ ! -f "${BASE_DIR}/docker-compose.local.yml" ]; then
+ echo "❌ ${BASE_DIR}/docker-compose.local.yml 파일을 찾을 수 없습니다." >&2
+ exit 1
+fi
+
docker compose -f "${BASE_DIR}/docker-compose.local.yml" up -d📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| docker compose -f "${BASE_DIR}/docker-compose.local.yml" up -d | |
| # … earlier in the script … | |
| # ③ docker-compose.local.yml 존재 여부 검사 | |
| if [ ! -f "${BASE_DIR}/docker-compose.local.yml" ]; then | |
| echo "❌ ${BASE_DIR}/docker-compose.local.yml 파일을 찾을 수 없습니다." >&2 | |
| exit 1 | |
| fi | |
| docker compose -f "${BASE_DIR}/docker-compose.local.yml" up -d |
🤖 Prompt for AI Agents
In docs/script/local_compose_up.sh at line 19, the script runs docker compose
with docker-compose.local.yml without checking if the file exists. Add a check
before this line to verify the presence of docker-compose.local.yml, and if it
does not exist, print a clear error message and exit the script to prevent
unclear stack traces from docker compose.
작업 내용
회의에서 논의 된 내용을 적용합니다.
특이 사항
수연님이 말씀하신 것처럼, Dockerfile의 위치는 프로젝트의 루트 경로가 관례라고 합니다.
말씀해주셔서 감사합니다! 🙇🏻♀️
따라서 docker-compose.{env}.yml 파일도 루트 경로에 뒀고,
나머지 파일들은 파일 때 건의드린대로 이동했습니다.