diff --git a/serverinfo/post-receive b/serverinfo/post-receive index 538ee36..3c583aa 100644 --- a/serverinfo/post-receive +++ b/serverinfo/post-receive @@ -134,9 +134,10 @@ rsync -a --delete $TEMP_DIR/node_modules/ $TARGET_SSR/node_modules/ # H. PM2 Management - SSR Next.js cd $TARGET_SSR echo ">>> Managing PM2 Process: $PM2_NAME_SSR..." +NEXT_VER=$(grep '"next":' package.json | sed -E 's/.*"next": "[\^~]?([0-9\.]+)".*/\1/') $PM2 restart $PM2_NAME_SSR 2>/dev/null || \ $PM2 start $BUN --name $PM2_NAME_SSR \ - -- x next start -p $SSR_PORT + -- x next@$NEXT_VER start -p $SSR_PORT echo "✅ PM2 process '$PM2_NAME_SSR' is running on port $SSR_PORT." # I. Cleanup