Fix Docker build retry and apt mirror
Some checks failed
Build and Deploy / build-and-deploy (push) Has been cancelled
Some checks failed
Build and Deploy / build-and-deploy (push) Has been cancelled
This commit is contained in:
parent
2a6216c706
commit
d0b34c664a
@ -41,19 +41,36 @@ jobs:
|
|||||||
id: build_toonflow
|
id: build_toonflow
|
||||||
run: |
|
run: |
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
BUILD_OK=0
|
||||||
for attempt in 1 2 3; do
|
for attempt in 1 2 3; do
|
||||||
echo "Build ToonFlow attempt $attempt/3..."
|
echo "Build ToonFlow attempt $attempt/3..."
|
||||||
DOCKER_BUILDKIT=0 docker build \
|
if DOCKER_BUILDKIT=0 docker build \
|
||||||
--tag ${{ env.CR_SERVER_ACTIVE }}/${{ env.CR_ORG }}/toonflow:${{ env.IMAGE_TAG }} \
|
--tag ${{ env.CR_SERVER_ACTIVE }}/${{ env.CR_ORG }}/toonflow:${{ env.IMAGE_TAG }} \
|
||||||
--tag ${{ env.CR_SERVER_ACTIVE }}/${{ env.CR_ORG }}/toonflow:latest \
|
--tag ${{ env.CR_SERVER_ACTIVE }}/${{ env.CR_ORG }}/toonflow:latest \
|
||||||
. 2>&1 | tee /tmp/build.log && break
|
. 2>&1 | tee /tmp/build.log; then
|
||||||
|
BUILD_OK=1
|
||||||
|
break
|
||||||
|
fi
|
||||||
echo "Attempt $attempt failed, retrying in 10s..." && sleep 10
|
echo "Attempt $attempt failed, retrying in 10s..." && sleep 10
|
||||||
done
|
done
|
||||||
|
if [ "$BUILD_OK" -ne 1 ]; then
|
||||||
|
echo "Docker build failed after 3 attempts."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
PUSH_OK=0
|
||||||
for attempt in 1 2 3; do
|
for attempt in 1 2 3; do
|
||||||
docker push ${{ env.CR_SERVER_ACTIVE }}/${{ env.CR_ORG }}/toonflow:${{ env.IMAGE_TAG }} && \
|
if docker push ${{ env.CR_SERVER_ACTIVE }}/${{ env.CR_ORG }}/toonflow:${{ env.IMAGE_TAG }} && \
|
||||||
docker push ${{ env.CR_SERVER_ACTIVE }}/${{ env.CR_ORG }}/toonflow:latest && break
|
docker push ${{ env.CR_SERVER_ACTIVE }}/${{ env.CR_ORG }}/toonflow:latest; then
|
||||||
|
PUSH_OK=1
|
||||||
|
break
|
||||||
|
fi
|
||||||
echo "Push attempt $attempt failed, retrying in 10s..." && sleep 10
|
echo "Push attempt $attempt failed, retrying in 10s..." && sleep 10
|
||||||
done
|
done
|
||||||
|
if [ "$PUSH_OK" -ne 1 ]; then
|
||||||
|
echo "Docker push failed after 3 attempts."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Setup Kubectl
|
- name: Setup Kubectl
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@ -3,8 +3,8 @@ FROM node:24-bookworm-slim
|
|||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
RUN sed -i \
|
RUN sed -i \
|
||||||
-e 's|http://deb.debian.org/debian|https://mirrors.aliyun.com/debian|g' \
|
-e 's|http://deb.debian.org/debian|http://mirrors.aliyun.com/debian|g' \
|
||||||
-e 's|http://deb.debian.org/debian-security|https://mirrors.aliyun.com/debian-security|g' \
|
-e 's|http://deb.debian.org/debian-security|http://mirrors.aliyun.com/debian-security|g' \
|
||||||
/etc/apt/sources.list.d/debian.sources && \
|
/etc/apt/sources.list.d/debian.sources && \
|
||||||
apt-get update && \
|
apt-get update && \
|
||||||
apt-get install -y --no-install-recommends ca-certificates python3 make g++ && \
|
apt-get install -y --no-install-recommends ca-certificates python3 make g++ && \
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user