From 7b4b4c2c371356779d413f3f11a457c7b499e919 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Han=C3=9F?= Date: Fri, 14 Aug 2026 14:03:05 +0000 Subject: [PATCH] chore(deploy): honest host banner + guard against npm cache EEXIST - Banner said 'PROD' regardless of target; now prints the actual host. - Interrupted installs can leave ~/.npm/_cacache/tmp corrupt, aborting npm ci with EEXIST; run 'npm cache verify' (falls back to clean) before install. --- deployment.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/deployment.sh b/deployment.sh index bc07404..c2ab3fe 100644 --- a/deployment.sh +++ b/deployment.sh @@ -14,7 +14,7 @@ on_error() { } trap on_error ERR INT TERM -log "=== Starting deployment to PROD (branch: ${BRANCH}) ===" +log "=== Starting deployment on $(hostname) (branch: ${BRANCH}) ===" # Sudo check (only needed for docker/compose, ideally) if ! sudo -n true 2>/dev/null; then @@ -42,6 +42,11 @@ log "Installing npm deps (non-root)..." # does a full reinstall regardless, so this costs no correctness, only a little # time on deploys that changed dependencies. rm -rf node_modules packages/*/node_modules +# An interrupted install can leave the npm cache tmp dir in a bad state, making +# the next `npm ci` abort with `EEXIST ... ~/.npm/_cacache/tmp/...`. Verify the +# cache first (prunes stale tmp entries); fall back to a full clean if verify +# itself trips. +npm cache verify || npm cache clean --force npm ci 2>&1 | tee -a "$LOG_FILE" log "Building docker images..."