2026-02-12 15:46:57 -08:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
# Rsync projects from local to Dev VM (5700). Run after SSH keys are added for dev1.
|
|
|
|
|
# Usage: bash scripts/dev-vm/rsync-projects-to-dev-vm.sh [--dry-run]
|
2026-02-21 15:46:06 -08:00
|
|
|
# Default target: dev1@192.168.11.59:/srv/projects/
|
2026-02-12 15:46:57 -08:00
|
|
|
set -euo pipefail
|
|
|
|
|
|
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
|
|
|
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
|
|
|
|
|
source "$PROJECT_ROOT/config/ip-addresses.conf" 2>/dev/null || true
|
|
|
|
|
|
|
|
|
|
DEV_USER="${DEV_USER:-dev1}"
|
2026-02-21 15:46:06 -08:00
|
|
|
DEV_HOST="${IP_DEV_VM:-192.168.11.59}"
|
2026-02-12 15:46:57 -08:00
|
|
|
# Source: parent of project root (e.g. /home/intlc/projects)
|
|
|
|
|
SOURCE_DIR="${SOURCE_DIR:-$(dirname "$PROJECT_ROOT")}"
|
|
|
|
|
DRY_RUN=""
|
|
|
|
|
[[ "${1:-}" == "--dry-run" ]] && DRY_RUN="--dry-run -v"
|
|
|
|
|
|
|
|
|
|
echo "Rsync: $SOURCE_DIR/ -> $DEV_USER@$DEV_HOST:/srv/projects/"
|
|
|
|
|
echo "Excludes: .git, node_modules, .venv, venv, dist, .next, coverage, build, __pycache__, etc."
|
|
|
|
|
rsync -avz $DRY_RUN \
|
|
|
|
|
--exclude='.git' \
|
|
|
|
|
--exclude='node_modules' \
|
|
|
|
|
--exclude='.cursor' \
|
|
|
|
|
--exclude='.venv' \
|
|
|
|
|
--exclude='venv' \
|
|
|
|
|
--exclude='__pycache__' \
|
|
|
|
|
--exclude='dist' \
|
|
|
|
|
--exclude='.next' \
|
|
|
|
|
--exclude='coverage' \
|
|
|
|
|
--exclude='build' \
|
|
|
|
|
--exclude='.turbo' \
|
|
|
|
|
--exclude='.pnpm-store' \
|
|
|
|
|
--exclude='.nx' \
|
|
|
|
|
--exclude='*.pyc' \
|
|
|
|
|
"$SOURCE_DIR/" "$DEV_USER@$DEV_HOST:/srv/projects/"
|