diff --git a/scripts/_deploy_git_pull_both.py b/scripts/_deploy_git_pull_both.py index 7400712..887b746 100644 --- a/scripts/_deploy_git_pull_both.py +++ b/scripts/_deploy_git_pull_both.py @@ -55,9 +55,12 @@ def git_sync(c: paramiko.SSHClient, *, sudo_prefix: str, label: str) -> int: code, _ = run( c, f"{sudo_prefix}bash -lc 'set -e; cd {REPO}; " - f"git remote set-url origin \"{REMOTE}\"; " + # Tarball physical installs may lack .git — bootstrap tracking without wiping data/. + f"if [ ! -d .git ]; then git init -b {BRANCH}; fi; " + f"git remote remove origin 2>/dev/null || true; " + f"git remote add origin \"{REMOTE}\"; " f"git fetch origin {BRANCH}; " - f"git reset --hard HEAD; " + f"git reset --hard HEAD 2>/dev/null || true; " f"git clean -fd -e backend/data -e frontend/.next -e node_modules -e frontend/node_modules " f"-e backend/.venv -e .venv -e \"*.db\" -e \"*.db-*\"; " f"git checkout -f -B {BRANCH} origin/{BRANCH}; " diff --git a/scripts/_deploy_physical_only.py b/scripts/_deploy_physical_only.py new file mode 100644 index 0000000..5286c7b --- /dev/null +++ b/scripts/_deploy_physical_only.py @@ -0,0 +1,19 @@ +#!/usr/bin/env python3 +"""Deploy origin/test1 to physical guest only (after dylive already OK).""" +from __future__ import annotations + +import sys +from pathlib import Path + +sys.path.insert(0, str(Path(__file__).resolve().parent)) +from _deploy_git_pull_both import PHYSICAL, deploy_host # noqa: E402 + +if __name__ == "__main__": + raise SystemExit( + deploy_host( + PHYSICAL, + label="physical", + public_health="https://dy.nomadro.com/api/health", + use_sudo=True, + ) + )