a3204a6d67
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 3s
CI/CD Pipeline / Validate - Type Check (mypy) (pull_request) Successful in 45s
CI/CD Pipeline / Validate - Code Quality (pull_request) Successful in 2m48s
CI/CD Pipeline / Validate - Migration (alembic) (pull_request) Successful in 49s
CI/CD Pipeline / Frontend Lint (pull_request) Failing after 22s
CI/CD Pipeline / Build Staging API Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Web Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Worker Image (pull_request) Has been skipped
CI/CD Pipeline / PR Build Web Image (pull_request) Successful in 1m21s
CI/CD Pipeline / PR Build API Image (pull_request) Failing after 1m41s
PR Automation / Auto Merge on CI Green + Approved (pull_request) Has been skipped
Preview Deploy / Deploy Preview Environment (pull_request) Failing after 16s
PR Automation / Auto Approve on CI Green (pull_request) Successful in 39s
AI Code Review / AI Code Review (pull_request) Successful in 55s
CI/CD Pipeline / Frontend Unit Tests (pull_request) Has been skipped
CI/CD Pipeline / Build Production API Image (pull_request) Has been skipped
CI/CD Pipeline / Build Production Web Image (pull_request) Has been skipped
CI/CD Pipeline / Build Production Worker Image (pull_request) Has been skipped
CI/CD Pipeline / PR Build Worker Image (pull_request) Successful in 4m25s
CI/CD Pipeline / Integration Tests (pull_request) Successful in 2m25s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Has been skipped
CI/CD Pipeline / Unit Tests (pull_request) Failing after 9m25s
CI/CD Pipeline / Deploy Production (pull_request) Has been skipped
CI/CD Pipeline / Staging E2E Tests (pull_request) Has been skipped
CI/CD Pipeline / Staging API Integration Tests (pull_request) Has been skipped
CI/CD Pipeline / ACR Image Cleanup (pull_request) Has been skipped
CI/CD Pipeline / Production Browser E2E (pull_request) Has been skipped
44 lines
1.0 KiB
Bash
Executable File
44 lines
1.0 KiB
Bash
Executable File
#!/bin/bash
|
|
# PR构建专用:只构建不输出,验证Dockerfile能否正常构建
|
|
# 无本地缓存(12个runner不共享,反而添乱),只用ACR远程缓存
|
|
set -eu
|
|
|
|
NO_CACHE_FLAG=""
|
|
if [ "$1" = "--no-cache" ]; then
|
|
NO_CACHE_FLAG="--no-cache"
|
|
shift
|
|
fi
|
|
|
|
DOCKERFILE="$1"
|
|
IMAGE_TAG="$2"
|
|
CACHE_REF="$3"
|
|
shift 3
|
|
BUILD_ARGS=""
|
|
for arg in "$@"; do
|
|
BUILD_ARGS="$BUILD_ARGS --build-arg $arg"
|
|
done
|
|
|
|
BUILDER_NAME="ci-pr-builder-${GITHUB_RUN_ID:-local}"
|
|
if ! docker buildx inspect "$BUILDER_NAME" > /dev/null 2>&1; then
|
|
docker buildx create --use --name "$BUILDER_NAME" --driver docker-container
|
|
else
|
|
docker buildx use "$BUILDER_NAME"
|
|
fi
|
|
docker buildx inspect --bootstrap
|
|
|
|
echo "=== PR Build: build only, no output, remote cache only ==="
|
|
echo "Dockerfile: ${DOCKERFILE}"
|
|
echo "Image tag: ${IMAGE_TAG}"
|
|
echo ""
|
|
|
|
docker buildx build \
|
|
$NO_CACHE_FLAG \
|
|
$BUILD_ARGS \
|
|
--cache-from "type=registry,ref=${CACHE_REF}" \
|
|
-f "${DOCKERFILE}" \
|
|
-t "${IMAGE_TAG}" \
|
|
.
|
|
|
|
echo ""
|
|
echo "PR build OK (build only, no output): ${IMAGE_TAG}"
|