fix(scripts): detect docker compose v2 in download_db.sh - #202
Open
dkijania wants to merge 1 commit into
Open
Conversation
download_db.sh hardcoded `docker-compose` (Compose v1), which is EOL since 2023 and not present on v2-only hosts — yet docs/getting-started.md tells users to run `docker compose up` (v2). So the documented setup failed here with "command not found". Detect whichever is installed, preferring v2, and error clearly if neither is. Salvaged from #125 (Staketab), whose other two files now conflict with #158's mainnet-3.3.1 refresh; this is the piece still worth landing. Verified: shellcheck clean, and the detection resolves to `docker compose` on a v2-only host (docker present, docker-compose absent). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
scripts/download_db.shhardcodesdocker-compose stop postgres— the Compose v1 binary, EOL since 2023 and absent on v2-only hosts. Butdocs/getting-started.md(Path C) tells users to rundocker compose up(v2). So on a v2-only machine the documented setup works right up untildownload_db.sh, which then fails withdocker-compose: command not found.This detects whichever Compose is installed — preferring v2 — and errors clearly if neither is present.
Provenance
This is the one salvageable hunk from #125 (Staketab). Per the review there, its other two files (
.env.example.compose,scripts/generate_libp2p.sh) now conflict with #158's mainnet-3.3.1 refresh and are best dropped, so this lands the real improvement on a clean branch offmain. Closes #125's useful part; recommend closing that PR once this merges.Testing
shellcheck scripts/download_db.sh— cleanbash -n— cleandocker-composeabsent): detection resolves todocker composeand reachesstop postgres. Simulated a v1-only host: resolves todocker-compose. Missing-both: exits 1 with a clear message.🤖 Generated with Claude Code
https://claude.ai/code/session_01ACRnT8ZHiAqEhusugky6fu