Deploy: use Next standalone start + robust ssh tty
Some checks failed
CI / Frontend Lint & Type Check (push) Has been cancelled
CI / Frontend Build (push) Has been cancelled
CI / Backend Lint (push) Has been cancelled
CI / Backend Tests (push) Has been cancelled
CI / Docker Build (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
Deploy / Build & Push Images (push) Has been cancelled
Deploy / Deploy to Server (push) Has been cancelled
Deploy / Notify (push) Has been cancelled
Some checks failed
CI / Frontend Lint & Type Check (push) Has been cancelled
CI / Frontend Build (push) Has been cancelled
CI / Backend Lint (push) Has been cancelled
CI / Backend Tests (push) Has been cancelled
CI / Docker Build (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
Deploy / Build & Push Images (push) Has been cancelled
Deploy / Deploy to Server (push) Has been cancelled
Deploy / Notify (push) Has been cancelled
This commit is contained in:
@ -109,7 +109,7 @@ fi
|
||||
# Step 3: Reload backend (graceful, no restart)
|
||||
if ! $FRONTEND_ONLY; then
|
||||
echo -e "\n${YELLOW}[3/4] Reloading backend (graceful)...${NC}"
|
||||
sshpass -p "$SERVER_PASS" ssh $SSH_OPTS $SERVER_USER@$SERVER_HOST << 'BACKEND_EOF'
|
||||
sshpass -p "$SERVER_PASS" ssh -tt $SSH_OPTS $SERVER_USER@$SERVER_HOST << 'BACKEND_EOF'
|
||||
set -e
|
||||
|
||||
cd ~/pounce/backend
|
||||
@ -150,7 +150,7 @@ fi
|
||||
# Step 4: Rebuild frontend (in background to minimize downtime)
|
||||
if ! $BACKEND_ONLY; then
|
||||
echo -e "\n${YELLOW}[4/4] Rebuilding frontend...${NC}"
|
||||
sshpass -p "$SERVER_PASS" ssh $SSH_OPTS $SERVER_USER@$SERVER_HOST << 'FRONTEND_EOF'
|
||||
sshpass -p "$SERVER_PASS" ssh -tt $SSH_OPTS $SERVER_USER@$SERVER_HOST << 'FRONTEND_EOF'
|
||||
cd ~/pounce/frontend
|
||||
|
||||
# Build new version
|
||||
@ -160,7 +160,7 @@ if ! $BACKEND_ONLY; then
|
||||
|
||||
if [ $BUILD_EXIT -eq 0 ]; then
|
||||
# Gracefully restart Next.js
|
||||
NEXT_PID=$(pgrep -af 'next-serv|next start' | awk 'NR==1{print $1; exit}')
|
||||
NEXT_PID=$(pgrep -af 'next-serv|next start|node \\.next/standalone/server\\.js' | awk 'NR==1{print $1; exit}')
|
||||
|
||||
if [ -n "$NEXT_PID" ]; then
|
||||
echo " Restarting Next.js (PID: $NEXT_PID)..."
|
||||
@ -173,7 +173,7 @@ if ! $BACKEND_ONLY; then
|
||||
sleep 2
|
||||
|
||||
# Verify
|
||||
NEW_PID=$(pgrep -af 'next-serv|next start' | awk 'NR==1{print $1; exit}')
|
||||
NEW_PID=$(pgrep -af 'next-serv|next start|node \\.next/standalone/server\\.js' | awk 'NR==1{print $1; exit}')
|
||||
if [ -n "$NEW_PID" ]; then
|
||||
echo " ✓ Frontend running (PID: $NEW_PID)"
|
||||
else
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
"scripts": {
|
||||
"dev": "next dev",
|
||||
"build": "next build",
|
||||
"start": "next start",
|
||||
"start": "HOSTNAME=0.0.0.0 PORT=3000 node .next/standalone/server.js",
|
||||
"lint": "next lint"
|
||||
},
|
||||
"dependencies": {
|
||||
|
||||
Reference in New Issue
Block a user