返回 CodeWhale
remote-sync.sh
根目录 / scripts / remote-sync.sh
1 #!/usr/bin/env bash
2 # remote-sync.sh — run on the Mac. Overlays the local Codewhale worktree onto
3 # whale-h100's clone at ~/CodeWhale (local → remote, one direction only).
4 #
5 # .git is excluded, so the remote clone keeps its git state and `git status`
6 # there shows exactly the local diff. The remaining excludes are heavy
7 # *ignored* directories that contain zero tracked files (verified with
8 # `git ls-files`): build output and dependency caches that no cargo build
9 # needs. Without them the first sync would push ~4.4G over the WAN for nothing.
10 #
11 # One-time remote setup: whale-h100:~/lane-setup.sh (rustup stable, mold,
12 # sccache, apt deps). Remote artifacts are x86_64 — CI-lane evidence only,
13 # never a local test result or a shipped artifact.
14 #
15 # .devin/ is hidden from local status by .git/info/exclude, which does not
16 # sync — without this exclude it lands untracked on the remote and breaks
17 # the local-diff parity check.
18 set -euo pipefail
19
20 SRC="${SRC:-/Volumes/VIXinSSD/CW/codewhale/}"
21 DEST="${DEST:-whale-h100:~/CodeWhale/}"
22 SSH_HOST="${SSH_HOST:-whale-h100}"
23
24 rsync -az --delete --itemize-changes \
25 --exclude .git \
26 --exclude target \
27 --exclude node_modules \
28 --exclude .entire \
29 --exclude .mimosa \
30 --exclude codewhale-inference \
31 --exclude pet/conformance-results \
32 --exclude extensions/vscode/out \
33 --exclude pet/ios/build \
34 --exclude pet/android/build \
35 --exclude npm/codewhale/bin/downloads \
36 --exclude .devin \
37 "$SRC" "$DEST"
38
39 echo '--- remote git status:'
40 ssh -o BatchMode=yes "$SSH_HOST" 'cd ~/CodeWhale && git status --short'
41
41 lines BASH