You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
#!/usr/bin/env bash
# 在容器内执行:为各子项目 npm ci, 再调用仓库根脚本( 路径挂载为 /work) 。
set -euo pipefail
cd /work
# npm 网络增强:默认使用官方 registry, 可通过 NPM_REGISTRY 覆盖;增加超时与重试,减少 ECONNRESET 失败概率。
npm config set registry " ${ NPM_REGISTRY :- https : //registry.npmjs.org/ } "
npm config set fetch-retries 5
npm config set fetch-retry-factor 2
npm config set fetch-retry-mintimeout 20000
npm config set fetch-retry-maxtimeout 120000
npm config set fetch-timeout 300000
for d in call-client broadcast-client; do
if [ [ ! -f " $d /package.json " ] ] ; then
echo " 错误: 缺少 /work/ $d /package.json " >& 2
exit 1
fi
(
cd " $d "
# npm ci 网络偶发抖动时最多重试 3 次
for i in 1 2 3; do
if npm ci; then
break
fi
if [ [ " $i " -eq 3 ] ] ; then
echo " 错误: $d npm ci 连续 3 次失败 " >& 2
exit 1
fi
echo " 警告: $d npm ci 失败, 10 秒后重试( $i /3) ... " >& 2
sleep 10
done
)
done
exec bash /work/scripts/build-linux-deb-all.sh " $@ "