fix(ci): stagger builds in stages and add retry for Harbor load

Split 3 builds into 2 stages (2+1) and add retry: 2.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Chever John 2026-06-17 10:20:10 +08:00
parent 4547ce7fed
commit 1cc62101d0

View File

@ -1,5 +1,6 @@
stages: stages:
- build - build-1
- build-2
variables: variables:
HARBOR_REGISTRY: harbor-in-k3s.cheverjohn.me HARBOR_REGISTRY: harbor-in-k3s.cheverjohn.me
@ -10,10 +11,10 @@ variables:
DOCKER_CERT_PATH: /certs/client DOCKER_CERT_PATH: /certs/client
.build-template: &build-template .build-template: &build-template
stage: build
image: docker:27 image: docker:27
services: services:
- docker:27-dind - docker:27-dind
retry: 2
before_script: before_script:
- until docker info >/dev/null 2>&1; do echo "Waiting for Docker daemon..."; sleep 2; done - until docker info >/dev/null 2>&1; do echo "Waiting for Docker daemon..."; sleep 2; done
- echo "$HARBOR_PASSWORD" | docker login $HARBOR_REGISTRY -u "$HARBOR_USER" --password-stdin - echo "$HARBOR_PASSWORD" | docker login $HARBOR_REGISTRY -u "$HARBOR_USER" --password-stdin
@ -32,18 +33,21 @@ variables:
build-muyu-gateway: build-muyu-gateway:
<<: *build-template <<: *build-template
stage: build-1
variables: variables:
IMAGE_NAME: muyu-gateway IMAGE_NAME: muyu-gateway
DOCKERFILE_PATH: deploy/Dockerfile.gateway DOCKERFILE_PATH: deploy/Dockerfile.gateway
build-muyu-system-rpc: build-muyu-system-rpc:
<<: *build-template <<: *build-template
stage: build-1
variables: variables:
IMAGE_NAME: muyu-system-rpc IMAGE_NAME: muyu-system-rpc
DOCKERFILE_PATH: deploy/Dockerfile.system DOCKERFILE_PATH: deploy/Dockerfile.system
build-muyu-inventory-rpc: build-muyu-inventory-rpc:
<<: *build-template <<: *build-template
stage: build-2
variables: variables:
IMAGE_NAME: muyu-inventory-rpc IMAGE_NAME: muyu-inventory-rpc
DOCKERFILE_PATH: deploy/Dockerfile.inventory DOCKERFILE_PATH: deploy/Dockerfile.inventory