update for pc server

This commit is contained in:
2025-11-24 20:44:31 +01:00
parent bd1d56e1d0
commit 9bfaa5e59b
2 changed files with 167 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
#!/bin/bash
# Deployment Script for ASF TestArena
# Usage: ./deploy.sh
echo "Starting deployment..."
# 1. Pull latest changes
echo "Pulling latest changes from git..."
git pull
# 2. Build Frontend
echo "Building frontend..."
cd frontend
npm install
npm run build
cd ..
# 3. Deploy Frontend
echo "Deploying frontend to /var/www/testarena..."
# Ensure directory exists
if [ ! -d "/var/www/testarena" ]; then
echo "Creating /var/www/testarena..."
sudo mkdir -p /var/www/testarena
sudo chown $USER:$USER /var/www/testarena
fi
# Copy files
sudo cp -r frontend/dist/* /var/www/testarena/
# 4. Restart Backend
echo "Restarting backend services..."
docker-compose down
docker-compose up -d --build
# 5. Reload Nginx (Optional, if config changed)
echo "Reloading Nginx..."
sudo systemctl reload nginx
echo "Deployment complete! Access at http://asf-testarena.duckdns.org"