#!/usr/bin/env bash
# Synka repo till prod-server utan att skriva över prod-specifik config.
# Körs från lokal/WSL-maskin mot cibello-prod.
set -euo pipefail

LOCAL_DIR="${1:-/home/dator_ubuntujpb/.openclaw/workspace/cibello-work/cibello/}"
REMOTE_USER="${2:-ubuntu}"
REMOTE_HOST="${3:-cibello-prod}"
REMOTE_DIR="${4:-/opt/cibello-platform/}"

echo "==> Synkar $LOCAL_DIR -> $REMOTE_USER@$REMOTE_HOST:$REMOTE_DIR"

rsync -avz --delete \
  --exclude='.git/' \
  --exclude='node_modules/' \
  --exclude='dist/' \
  --exclude='.env' \
  --exclude='secrets/' \
  --exclude='certs/' \
  "$LOCAL_DIR" "$REMOTE_USER@$REMOTE_HOST:$REMOTE_DIR"

echo "==> Synk klar"
