- Updated `ensure_node_version` function in `deploy-production.sh` and `deploy-test.sh` to use a common script for Node.js version validation.
- Simplified PM2 instance restart logic by introducing `deploy_restart_pm2` function in a new `deploy-runtime.sh` script.
- Replaced direct PM2 commands with the new function to handle instance restarts and HTTP readiness checks.
- Modified PM2 configuration files to set the script directly instead of using `node` as the interpreter, allowing for better compatibility with older Node.js versions.
- Added tests for the new deployment runtime functions in `deploy-runtime.spec.ts` to ensure correct behavior during deployment.
- Updated `package-lock.json` to include new dependencies and ensure compatibility with the latest changes.
This commit updates the deploy-production.sh script to check if the server/data directory is a symlink and removes it if necessary, ensuring that data is copied to a real directory. It also modifies the data restoration process to follow symlinks when copying from the backup, improving the reliability of data recovery during deployment.