From 784e539af338a41b65061e0582ac380423a89601 Mon Sep 17 00:00:00 2001 From: nmemmert <67961292+nmemmert@users.noreply.github.com> Date: Tue, 11 Aug 2026 15:09:48 -0400 Subject: [PATCH] Fix update script: remove server-side client build Server can't handle the React build. Client is built locally and committed to git; update-server.sh just pulls and restarts PM2. Co-Authored-By: Claude Sonnet 4.6 --- update-server.sh | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/update-server.sh b/update-server.sh index 7b4b7c5..5c62a8f 100644 --- a/update-server.sh +++ b/update-server.sh @@ -1,32 +1,20 @@ #!/bin/bash -# SkyWatch update script — run on the server to pull and deploy the latest version -# Usage: bash update-server.sh [--skip-build] +# SkyWatch update script — run on the server to pull and deploy the latest version. +# The React client is built locally and committed to git before running this. +# Usage: bash update-server.sh set -e APP_DIR="/opt/resource-monitor" -SKIP_BUILD=false -for arg in "$@"; do [[ "$arg" == "--skip-build" ]] && SKIP_BUILD=true; done echo "==> Updating SkyWatch at ${APP_DIR} ..." cd "$APP_DIR" -echo "==> Pulling latest code ..." +echo "==> Pulling latest code (includes pre-built client) ..." git pull origin main echo "==> Installing/updating server dependencies ..." -# Use npm install (not ci + rm -rf) so existing compatible packages stay in place npm install --omit=dev 2>&1 | tail -20 -if [ "$SKIP_BUILD" = false ]; then - echo "==> Building React client ..." - cd client - npm install 2>&1 | tail -10 - npm run build 2>&1 | tail -20 - cd .. -else - echo "==> Skipping client build (--skip-build flag set)" -fi - echo "==> Restarting application via PM2 ..." pm2 restart resource-monitor