Conversation
WalkthroughSeveral new shell scripts were added to automate and manage various aspects of the "Runimo" application's lifecycle, including building, starting, stopping, resource monitoring, log cleanup, and Docker container management. Additionally, the Gradle build configuration was updated to specify custom naming for the Spring Boot jar artifact. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant StartScript as start-server.sh
participant Gradle
participant JavaApp as Runimo.jar
participant Logs
User->>StartScript: ./start-server.sh build-start [profile]
StartScript->>Gradle: gradle clean bootJar
Gradle-->>StartScript: Build artifact (Runimo.jar)
StartScript->>JavaApp: java -jar Runimo.jar --spring.profiles.active=[profile]
JavaApp->>Logs: Write logs to log directory
sequenceDiagram
participant User
participant DockerScript as docker-start.sh
participant Docker
participant RunimoContainer
User->>DockerScript: ./docker-start.sh start [profile]
DockerScript->>Docker: Stop and remove existing container
DockerScript->>Docker: Pull image from Docker Hub
DockerScript->>Docker: Run new container with environment/profile
Docker->>RunimoContainer: Start container
User->>DockerScript: ./docker-start.sh logs
DockerScript->>Docker: Show container logs
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (6)
Note 🎁 Summarized by CodeRabbit FreeYour organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Join our Discord community 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.
Pull Request Overview
Adds a set of shell scripts to support deployment, monitoring, and log management:
- Introduces
system-resource.shfor on-demand system metrics. - Provides
start-server.sh/stop-server.shfor launching and terminating the Spring Boot JAR. - Adds
docker-start.shfor container lifecycle operations andclean-logs.shfor log pruning.
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| shell/system-resource.sh | New script to print system, CPU, memory, disk, process, network, Spring app, and Docker statuses |
| shell/stop-server.sh | Script to stop the Runimo application |
| shell/start-server.sh | Script to build and start the Runimo application |
| shell/docker-start.sh | Script to pull, start, restart, stop, and view logs of a Docker container |
| shell/clean-logs.sh | Script to delete old and empty log files |
Comments suppressed due to low confidence (2)
shell/stop-server.sh:6
- Missing space before the closing bracket in the test expression, causing a syntax error. It should be:
if [ -z "$pid" ]; then.
if [ -z "$pid"]; then
shell/stop-server.sh:10
- The echo statement is malformed:
process exitis outside the quotes. Wrap the entire message or separate arguments correctly, for example:echo "$SERVICE_NAME $pid closing... process exit".
echo "$SERVICE_NAME $pid closing..." process exit
| pid=`ps -elf | grep org.runimo.$SERVICE_NAME.jar` | ||
|
|
||
| if [ -z "$pid"]; then |
There was a problem hiding this comment.
[nitpick] Using grep on ps output can capture the grep process itself and returns full lines instead of just the PID. Consider using pgrep -f org.runimo.$SERVICE_NAME.jar to reliably retrieve the PID.
| pid=`ps -elf | grep org.runimo.$SERVICE_NAME.jar` | |
| if [ -z "$pid"]; then | |
| pid=$(pgrep -f org.runimo.$SERVICE_NAME.jar) | |
| if [ -z "$pid" ]; then |
|
|
||
| echo "프로필 $profile 로 애플리케이션 실행..." | ||
| nohup java -Xms512m -Xmx512m \ | ||
| -jar -Dspring.profiles.active=$profile $JAR_FILE > "$LOG_DIR/$APP_NAME-$(date +%Y%m%d).log" 2>&1 & |
There was a problem hiding this comment.
The -jar flag must be followed directly by the JAR file path; JVM options like -Dspring.profiles.active should precede -jar. For example:
java -Xms512m -Xmx512m -Dspring.profiles.active=$profile -jar $JAR_FILE
| -jar -Dspring.profiles.active=$profile $JAR_FILE > "$LOG_DIR/$APP_NAME-$(date +%Y%m%d).log" 2>&1 & | |
| -Dspring.profiles.active=$profile -jar $JAR_FILE > "$LOG_DIR/$APP_NAME-$(date +%Y%m%d).log" 2>&1 & |
| *) | ||
| echo "사용법: $0 {build|start|build-start} [profile]" | ||
| echo " build: 애플리케이션 빌드" | ||
| echo " start [profile]: 특정 프로필로 애플리케이션 실행 (기본값: local)" |
There was a problem hiding this comment.
The usage message states the default profile is local, but the script actually defaults to dev. Align the help text with the code or vice versa.
| echo " start [profile]: 특정 프로필로 애플리케이션 실행 (기본값: local)" | |
| echo " start [profile]: 특정 프로필로 애플리케이션 실행 (기본값: dev)" |
| print_memory_info() { | ||
| echo -e "${BLUE}=== 메모리 정보 ===${NC}" | ||
| if [[ "$OS_TYPE" == "Linux" ]]; then | ||
| read total used free shared buff cache available < <(free -m | awk 'NR==2{print $2, $3, $4, $5, $6, $7, $7}') |
There was a problem hiding this comment.
The AWK command prints field 7 twice, assigning both cache and available to the same value, and the script later echoes free instead of available for available memory. Adjust the AWK fields and variable assignments to correctly capture and display available memory.
| read total used free shared buff cache available < <(free -m | awk 'NR==2{print $2, $3, $4, $5, $6, $7, $7}') | |
| read total used free shared buff cache available < <(free -m | awk 'NR==2{print $2, $3, $4, $5, $6, $7}') |
| @@ -0,0 +1,14 @@ | |||
| #!/bin/bash | |||
|
|
|||
| LOG_DIR="../logs" | |||
There was a problem hiding this comment.
[nitpick] Using a hardcoded relative path may lead to inconsistencies between scripts. Consider deriving the script's directory with dirname "$0" and constructing an absolute path to the logs folder for consistency.
| LOG_DIR="../logs" | |
| SCRIPT_DIR="$(dirname "$0")" | |
| LOG_DIR="$(realpath "$SCRIPT_DIR/../logs")" |
작업 내역
Summary by CodeRabbit
New Features
Chores