Retry SharedCode fetches in Docker builds
This commit is contained in:
1 parent
778cded8bf
commit
bb6a7d0fed
4 files changed
+59
-5
No files matched your search
@@ -34,7 +34,19 @@ jobs:
|
|||||||
submodules: false
|
submodules: false
|
||||||
- name: Checkout latest SharedCode
|
- name: Checkout latest SharedCode
|
||||||
working-directory: ${{ github.workspace }}
|
working-directory: ${{ github.workspace }}
|
||||||
run: git clone --depth 1 --branch main --single-branch https://repos.gfranz.ch/Gabriel20xx/SharedCode.git SharedCode
|
run: |
|
||||||
|
for attempt in 1 2 3 4 5; do
|
||||||
|
rm -rf SharedCode
|
||||||
|
if git clone --depth 1 --branch main --single-branch https://repos.gfranz.ch/Gabriel20xx/SharedCode.git SharedCode; then
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
if [ "$attempt" -eq 5 ]; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
delay=$((attempt * 5))
|
||||||
|
echo "SharedCode clone failed (attempt ${attempt}/5); retrying in ${delay}s..." >&2
|
||||||
|
sleep "$delay"
|
||||||
|
done
|
||||||
|
|
||||||
# Multi-arch (arm64) is only built and published from main; other branches and PRs
|
# Multi-arch (arm64) is only built and published from main; other branches and PRs
|
||||||
# only need an amd64 build to validate they compile, which needs no emulation.
|
# only need an amd64 build to validate they compile, which needs no emulation.
|
||||||
|
|||||||
@@ -35,7 +35,19 @@ jobs:
|
|||||||
submodules: false
|
submodules: false
|
||||||
- name: Checkout latest SharedCode
|
- name: Checkout latest SharedCode
|
||||||
working-directory: ${{ github.workspace }}
|
working-directory: ${{ github.workspace }}
|
||||||
run: git clone --depth 1 --branch main --single-branch https://repos.gfranz.ch/Gabriel20xx/SharedCode.git SharedCode
|
run: |
|
||||||
|
for attempt in 1 2 3 4 5; do
|
||||||
|
rm -rf SharedCode
|
||||||
|
if git clone --depth 1 --branch main --single-branch https://repos.gfranz.ch/Gabriel20xx/SharedCode.git SharedCode; then
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
if [ "$attempt" -eq 5 ]; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
delay=$((attempt * 5))
|
||||||
|
echo "SharedCode clone failed (attempt ${attempt}/5); retrying in ${delay}s..." >&2
|
||||||
|
sleep "$delay"
|
||||||
|
done
|
||||||
|
|
||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
|
|||||||
@@ -35,7 +35,19 @@ jobs:
|
|||||||
submodules: false
|
submodules: false
|
||||||
- name: Checkout latest SharedCode
|
- name: Checkout latest SharedCode
|
||||||
working-directory: ${{ github.workspace }}
|
working-directory: ${{ github.workspace }}
|
||||||
run: git clone --depth 1 --branch main --single-branch https://repos.gfranz.ch/Gabriel20xx/SharedCode.git SharedCode
|
run: |
|
||||||
|
for attempt in 1 2 3 4 5; do
|
||||||
|
rm -rf SharedCode
|
||||||
|
if git clone --depth 1 --branch main --single-branch https://repos.gfranz.ch/Gabriel20xx/SharedCode.git SharedCode; then
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
if [ "$attempt" -eq 5 ]; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
delay=$((attempt * 5))
|
||||||
|
echo "SharedCode clone failed (attempt ${attempt}/5); retrying in ${delay}s..." >&2
|
||||||
|
sleep "$delay"
|
||||||
|
done
|
||||||
|
|
||||||
- name: Set up Go
|
- name: Set up Go
|
||||||
uses: actions/setup-go@v5
|
uses: actions/setup-go@v5
|
||||||
@@ -62,7 +74,19 @@ jobs:
|
|||||||
submodules: false
|
submodules: false
|
||||||
- name: Checkout latest SharedCode
|
- name: Checkout latest SharedCode
|
||||||
working-directory: ${{ github.workspace }}
|
working-directory: ${{ github.workspace }}
|
||||||
run: git clone --depth 1 --branch main --single-branch https://repos.gfranz.ch/Gabriel20xx/SharedCode.git SharedCode
|
run: |
|
||||||
|
for attempt in 1 2 3 4 5; do
|
||||||
|
rm -rf SharedCode
|
||||||
|
if git clone --depth 1 --branch main --single-branch https://repos.gfranz.ch/Gabriel20xx/SharedCode.git SharedCode; then
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
if [ "$attempt" -eq 5 ]; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
delay=$((attempt * 5))
|
||||||
|
echo "SharedCode clone failed (attempt ${attempt}/5); retrying in ${delay}s..." >&2
|
||||||
|
sleep "$delay"
|
||||||
|
done
|
||||||
|
|
||||||
- name: Set up Node.js
|
- name: Set up Node.js
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
|
|||||||
+7
-1
@@ -2,7 +2,13 @@ FROM node:22-alpine AS frontend-builder
|
|||||||
RUN apk add --no-cache git
|
RUN apk add --no-cache git
|
||||||
WORKDIR /frontend
|
WORKDIR /frontend
|
||||||
COPY frontend/package*.json ./
|
COPY frontend/package*.json ./
|
||||||
RUN npm ci
|
RUN for attempt in 1 2 3 4 5; do \
|
||||||
|
npm ci && break; \
|
||||||
|
if [ "$attempt" -eq 5 ]; then exit 1; fi; \
|
||||||
|
delay=$((attempt * 5)); \
|
||||||
|
echo "SharedCode npm install failed (attempt ${attempt}/5); retrying in ${delay}s..." >&2; \
|
||||||
|
sleep "$delay"; \
|
||||||
|
done
|
||||||
COPY frontend/ ./
|
COPY frontend/ ./
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user