-
Notifications
You must be signed in to change notification settings - Fork 39
Fix docker down #729
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
Fix docker down #729
Conversation
WalkthroughThe script Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant DownScript
participant DockerComposeMain
participant DockerComposeRegister
User->>DownScript: Run script with optional [profile] argument
DownScript->>DownScript: Determine profile ("single" or "dual", default to "single")
DownScript->>DockerComposeMain: Bring down main project (docker-compose.yml) with env/local.env
DownScript->>DockerComposeRegister: Bring down register project (docker-compose-register.yml) with selected profile and env/local.env
Tip ⚡💬 Agentic Chat (Pro Plan, General Availability)
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:
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: 0
🧹 Nitpick comments (1)
dev/docker/down (1)
4-12: Simplify the profile selection logic.There's redundancy in the current profile handling. Line 4 already sets a default value of "single" with
profile=${1:-single}, but then the conditional block potentially overwrites it in all cases.Additionally, the
elsebranch says it's defaulting to "single" but doesn't explicitly set the variable, relying on line 4 for the default value.Consider simplifying the logic:
-profile=${1:-single} - -if [ "$1" = "single" ]; then - profile="single" -elif [ "$1" = "dual" ]; then - profile="dual" -else - echo "No profile provided, defaulting to single" -fi +profile=${1:-single} + +if [ "$profile" != "single" ] && [ "$profile" != "dual" ]; then + echo "Invalid profile '$profile', defaulting to single" + profile="single" +fi
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
dev/docker/down(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (4)
- GitHub Check: Push Docker Images to GitHub Packages (xmtpd-cli)
- GitHub Check: Push Docker Images to GitHub Packages (xmtpd)
- GitHub Check: Test (Node)
- GitHub Check: Upgrade Tests
🔇 Additional comments (1)
dev/docker/down (1)
14-25: Docker Compose configuration looks correct.The Docker Compose commands are properly constructed to bring down two separate projects with appropriate configuration files, environment settings, and project names. The use of
--remove-orphansand--volumesflags ensures a clean shutdown.
Modify
dev/docker/downscript to support multiple Docker Compose profiles and separate project configurationsxmtpdandxmtpd_register_nodesprojectsdev/local.envenvironment file and--remove-orphans --volumesflags📍Where to Start
Begin by reviewing the main script logic in down which contains the profile handling mechanism and Docker Compose commands.
Macroscope summarized cf8f46c.
Summary by CodeRabbit