fix(ci): sync npm lockfiles so fleet deploy npm ci succeeds

Hub and admin-web package-lock.json were missing @emnapi/* entries that
npm 11 on the Alpha host requires, so deploy_fleet_release failed at
npm ci. Regenerate both lockfiles and retry incomplete release trees.
This commit is contained in:
2026-07-15 00:18:22 +08:00
parent 7269480abb
commit 78f94fcc8c
3 changed files with 151 additions and 35 deletions
+16 -7
View File
@@ -62,10 +62,23 @@ if ssh "${SSH_OPTS[@]}" "$DEPLOY_USER@$HOST" "test -f '$RELEASE_DIR/.complete'";
fi
if [ "$release_ready" = false ]; then
echo "[fleet] rsync hub → $HUB_DIR"
ssh "${SSH_OPTS[@]}" "$DEPLOY_USER@$HOST" \
"flock /var/lock/cph-hub-release-publish mkdir -p '$HUB_DIR'"
# Drop a prior incomplete tree for this release id (failed CI leave leftovers).
ssh "${SSH_OPTS[@]}" "$DEPLOY_USER@$HOST" bash -s <<REMOTE
set -euo pipefail
flock /var/lock/cph-hub-release-publish bash -c '
set -euo pipefail
if [ -f "$RELEASE_DIR/.complete" ]; then
exit 0
fi
if [ -e "$RELEASE_DIR" ]; then
echo "[fleet] removing incomplete release: $RELEASE_DIR"
rm -rf "$RELEASE_DIR"
fi
mkdir -p "$HUB_DIR"
'
REMOTE
echo "[fleet] rsync hub → $HUB_DIR"
rsync -az --delete \
--exclude node_modules --exclude dist --exclude .env \
--exclude admin-web/node_modules --exclude admin-web/build --exclude admin-web/.svelte-kit \
@@ -81,10 +94,6 @@ flock /var/lock/cph-hub-release-publish bash -c '
echo "[fleet] release completed by another job"
exit 0
fi
if [ -e "$RELEASE_DIR" ] && [ ! -f "$RELEASE_DIR/.complete" ] && [ ! -d "$HUB_DIR" ]; then
echo "incomplete release tree: $RELEASE_DIR" >&2
exit 1
fi
cd "$HUB_DIR"
npm ci
npm ci --prefix admin-web