mirror of
https://github.com/Dvorinka/Primora.git
synced 2026-10-28 07:41:23 +00:00
fix(install): fail fast when GitHub fetch stalls (#46)
curl without timeouts hangs silently on a stalled connection — the install looked dead between 'Fetching compose files' and the image pulls. --connect-timeout/--max-time/--retry-all-errors turn it into a clear error naming the file. Co-authored-by: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
1 parent
61f0974c61
commit
bc8b165ad9
1 file changed
+6
-2
+6
-2
@@ -38,9 +38,12 @@ mkdir -p "$DIR/infra/nginx"
|
|||||||
cd "$DIR"
|
cd "$DIR"
|
||||||
|
|
||||||
# The compose stack needs exactly these three files from the repo.
|
# The compose stack needs exactly these three files from the repo.
|
||||||
|
# Timeouts + retries: a stalled connection must fail loudly, not hang.
|
||||||
info "Fetching compose files ($REF)"
|
info "Fetching compose files ($REF)"
|
||||||
for f in docker-compose.yml .env.example infra/nginx/default.conf; do
|
for f in docker-compose.yml .env.example infra/nginx/default.conf; do
|
||||||
curl -fsSL "https://raw.githubusercontent.com/$REPO/$REF/$f" -o "$f"
|
curl -fsSL --connect-timeout 10 --max-time 60 --retry 3 --retry-delay 1 --retry-all-errors \
|
||||||
|
"https://raw.githubusercontent.com/$REPO/$REF/$f" -o "$f" \
|
||||||
|
|| die "could not fetch $f — check connectivity to raw.githubusercontent.com"
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ -f .env ]; then
|
if [ -f .env ]; then
|
||||||
@@ -129,7 +132,8 @@ if docker pull "ghcr.io/$GHCR_OWNER/primora-backend:latest" \
|
|||||||
else
|
else
|
||||||
# GHCR packages are private until first published release — build from source.
|
# GHCR packages are private until first published release — build from source.
|
||||||
info "Prebuilt images unavailable; building from source"
|
info "Prebuilt images unavailable; building from source"
|
||||||
curl -fsSL "https://codeload.github.com/$REPO/tar.gz/refs/heads/$REF" | tar xz --strip-components=1
|
curl -fsSL --connect-timeout 10 --max-time 120 --retry 3 --retry-delay 1 --retry-all-errors \
|
||||||
|
"https://codeload.github.com/$REPO/tar.gz/refs/heads/$REF" | tar xz --strip-components=1
|
||||||
docker compose up -d --build
|
docker compose up -d --build
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user