Files
xiaoxia-saas/scripts/ci/step_frontend_install.sh
T
xiaoxia 43815e5f20
Preview Deploy / Deploy Preview Environment (pull_request) Successful in 1m4s
PR Automation / Auto Approve on CI Green (pull_request) Successful in 2m15s
AI Code Review / AI Code Review (pull_request) Successful in 3m34s
PR Automation / Auto Merge on CI Green + Approved (pull_request) Successful in 16m53s
CI/CD Pipeline / Frontend Unit Tests (pull_request) Failing after 1359h10m7s
CI/CD Pipeline / Production Browser E2E (pull_request) Failing after 1359h10m46s
CI/CD Pipeline / ACR Image Cleanup (pull_request) Failing after 1359h10m50s
CI/CD Pipeline / Staging API Integration Tests (pull_request) Failing after 1359h10m52s
CI/CD Pipeline / Build Production Web Image (pull_request) Failing after 1359h10m58s
CI/CD Pipeline / Staging E2E Tests (pull_request) Failing after 1359h10m54s
CI/CD Pipeline / Build Production API Image (pull_request) Failing after 1359h11m0s
CI/CD Pipeline / Build Staging Web Image (pull_request) Failing after 1359h11m5s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Failing after 1359h11m2s
CI/CD Pipeline / Build Staging API Image (pull_request) Failing after 1359h11m5s
CI/CD Pipeline / Check if frontend-only change (pull_request) Has been skipped
CI/CD Pipeline / Validate Code Quality And Tests (pull_request) Has been skipped
CI/CD Pipeline / Unit Tests (pull_request) Has been skipped
CI/CD Pipeline / Integration Tests (pull_request) Has been skipped
CI/CD Pipeline / Frontend Lint (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Worker Image (pull_request) Failing after 1359h43m16s
CI/CD Pipeline / Deploy Production (pull_request) Failing after 1359h43m0s
CI/CD Pipeline / Build Production Worker Image (pull_request) Failing after 1359h43m8s
ci: 前端npm安装增加国内镜像源,加重试间隔
- npm registry改为npmmirror.com国内镜像,加速下载减少失败
- 重试间隔从5s增加到10s,给网络恢复更多时间
2026-07-22 00:17:56 +08:00

26 lines
735 B
Bash
Executable File

#!/bin/sh
# CI 公共步骤:前端依赖安装(在 docker node 容器中运行)
# 优化:增加国内npm镜像源,加重试间隔
set -eu
MODE="${1:-full}"
echo "=== 前端依赖安装开始 (模式: $MODE) ==="
# npm国内镜像源(加速下载,减少网络失败)
NPM_REGISTRY="https://registry.npmmirror.com"
for i in 1 2 3; do
echo "npm ci 尝试 $i/3 (镜像: $NPM_REGISTRY)"
docker run --rm \
-v "$PWD:/workspace" \
-w /workspace/apps/web \
docker.m.daocloud.io/library/node:20 \
sh -lc "npm config set registry $NPM_REGISTRY && npm ci --no-audit --no-fund" && break
echo "npm ci 失败,重试 $i/3..."
[ $i -eq 3 ] && exit 1
sleep 10
done
echo "=== 前端依赖安装完成 ==="