#!/bin/bash
# scripts/deploy/deploy-control-plane.sh
set -e

VPS_IP="100.95.58.48"
USER="oskar"
REMOTE_REPO_PATH="/home/oskar/homelab-codex-ws"

MODE=$1

case "$MODE" in
    "--ssh")
        echo "Deploying to VPS ($VPS_IP) via SSH..."
        ssh -t "$USER@$VPS_IP" "cd $REMOTE_REPO_PATH && git pull origin master && cd services/control-plane && bash deploy-local.sh"
        ;;
    "--print")
        echo "ssh -t $USER@$VPS_IP \"cd $REMOTE_REPO_PATH && git pull origin master && cd services/control-plane && bash deploy-local.sh\""
        ;;
    *)
        echo "Usage: $0 [--ssh|--print]"
        exit 1
        ;;
esac
