- Add empty brand field to API requests until server is updated - Create deployment script for updating API server - This fixes the 500 error when adding/editing filaments
39 lines
1.1 KiB
Bash
Executable File
39 lines
1.1 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# Simple deployment script for API server
|
|
# This updates the API server code on EC2
|
|
|
|
API_SERVER_IP="3.71.161.51"
|
|
API_SERVER_URL="https://api.filamenteka.rs"
|
|
|
|
echo "🚀 Deploying API server updates..."
|
|
|
|
# Create a temporary deployment package
|
|
echo "📦 Creating deployment package..."
|
|
mkdir -p tmp-deploy
|
|
cp -r api/* tmp-deploy/
|
|
cp package.json tmp-deploy/
|
|
cp package-lock.json tmp-deploy/
|
|
|
|
# Create tarball
|
|
tar -czf api-deploy.tar.gz -C tmp-deploy .
|
|
rm -rf tmp-deploy
|
|
|
|
echo "📤 Package created: api-deploy.tar.gz"
|
|
echo ""
|
|
echo "⚠️ Manual deployment required:"
|
|
echo "1. Copy api-deploy.tar.gz to your server"
|
|
echo "2. SSH into the server at $API_SERVER_IP"
|
|
echo "3. Extract and restart the API service:"
|
|
echo " tar -xzf api-deploy.tar.gz"
|
|
echo " npm install --production"
|
|
echo " sudo systemctl restart node-api"
|
|
echo ""
|
|
echo "4. Run database migration if needed:"
|
|
echo " psql -U filamenteka_admin -d filamenteka < database/migrations/004_remove_brand_column.sql"
|
|
|
|
# Cleanup
|
|
rm -f api-deploy.tar.gz
|
|
|
|
echo ""
|
|
echo "✅ Deployment package instructions complete!" |