Something went wrong. Try again.
Monorepo for Aesthetic.Computer aesthetic.computer
Something went wrong. Try again.
1.3 kB ยท 47 lines
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748#!/usr/bin/env fish# Deploy session server to production VPS
set SERVER "root@157.245.134.225"set DEPLOY_PATH "/root/aesthetic-computer"
echo "๐ Deploying session server to production..."echo ""
# Step 1: Update code on serverecho "๐ฅ Step 1/4: Pulling latest code..."ssh $SERVER "cd $DEPLOY_PATH && git pull origin main"
if test $status -ne 0 echo "โ Failed to pull code from GitHub" exit 1end
echo ""echo "๐ฆ Step 2/4: Installing dependencies..."ssh $SERVER "cd $DEPLOY_PATH/session-server && npm install"
if test $status -ne 0 echo "โ Failed to install dependencies" exit 1end
echo ""echo "๐ Step 3/4: Restarting session server with pm2..."ssh $SERVER "cd $DEPLOY_PATH && pm2 restart session-server || pm2 start session-server/session.mjs --name session-server --env production"
if test $status -ne 0 echo "โ Failed to restart session server" exit 1end
echo ""echo "๐ Step 4/4: Checking server status..."sleep 2ssh $SERVER "pm2 list && pm2 logs session-server --lines 10 --nostream"
echo ""echo "โ
Deployment complete!"echo ""echo "๐ Monitor logs with: ssh $SERVER 'pm2 logs session-server'"echo "๐ Restart with: ssh $SERVER 'pm2 restart session-server'"echo "๐ Check status: ssh $SERVER 'pm2 status session-server'"