#!/bin/bash

set -e

echo "=================================="
echo "Deploying Lucos Gateway Service "
echo "=================================="

APP_DIR="/var/www/dev.lucos.com/api.lucos.com"

cd "$APP_DIR" || {
    echo "Directory not found: $APP_DIR"
    exit 1
}

echo "Pulling latest code..."
git pull

echo "Installing dependencies..."
npm install

echo "Reloading PM2..."
pm2 reload ecosystem.config.js

echo "✅ Lucos Gateway Service deployment completed."
