-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.sh
More file actions
executable file
·43 lines (35 loc) · 1.48 KB
/
deploy.sh
File metadata and controls
executable file
·43 lines (35 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/usr/bin/env bash
# Deploy gopro sentinel to the roaster machine.
#
# Two modes:
# ./deploy.sh — rsync only changed .py files (~1s)
# ./deploy.sh --full — rsync all files + reinstall deps
#
# Requires SSH alias "roaster" configured in ~/.ssh/config
set -euo pipefail
REMOTE="${DEPLOY_SSH_HOST:?Set DEPLOY_SSH_HOST to your roaster SSH alias or user@host}"
REMOTE_DIR="${DEPLOY_REMOTE_DIR:-~/CodeProjects/gopro}"
LOCAL_DIR="$(cd "$(dirname "$0")" && pwd)"
# Color output helpers
green() { printf '\033[32m%s\033[0m\n' "$1"; }
yellow() { printf '\033[33m%s\033[0m\n' "$1"; }
if [[ "${1:-}" == "--full" ]]; then
# Full deploy: rsync everything (code, reference images) + reinstall deps
yellow "Full deploy: syncing all project files..."
rsync -avz \
--exclude='__pycache__/' --exclude='.venv/' --exclude='captures/' \
--exclude='*.pyc' \
"$LOCAL_DIR/" "$REMOTE:$REMOTE_DIR/"
yellow "Reinstalling dependencies..."
ssh "$REMOTE" "source ~/.local/bin/env && cd $REMOTE_DIR && uv pip install open-gopro anthropic websockets numpy pillow"
green "Full deploy complete."
else
# Quick deploy: rsync .py files and docs (~1s)
yellow "Quick deploy: syncing .py files to roaster..."
rsync -avz "$LOCAL_DIR/"*.py "$REMOTE:$REMOTE_DIR/"
green "Quick deploy complete."
fi
# Show what's running on roaster
echo ""
yellow "Verifying deployment..."
ssh "$REMOTE" "ls -la $REMOTE_DIR/*.py | wc -l" | xargs -I{} echo " {} Python files deployed"