Remove LocalMods from git, rsync directly to homelabvm

This commit is contained in:
2026-06-09 13:35:00 +03:00
parent 396753c367
commit 10859a335b
5 changed files with 16 additions and 74 deletions

24
prep
View File

@@ -1,5 +1,5 @@
#!/usr/bin/env python3
"""Prepare local mods, tar them, generate config, and commit."""
"""Prepare local mods, rsync to server, generate config, and commit."""
import os
import subprocess
@@ -9,7 +9,8 @@ BASE = os.path.dirname(os.path.abspath(__file__))
PREPARE_LOCAL = os.path.join(BASE, "prepare_local")
AUTOGEN = os.path.join(BASE, "scripts", "autogen_config.py")
LOCALMODS_DIR = os.path.join(BASE, "LocalMods")
TAR_PATH = os.path.join(BASE, "LocalMods.tar.gz")
RSYNC_DEST = "root@homelabvm:/opt/barotrauma/LocalMods/"
def log_ok(msg):
@@ -26,9 +27,9 @@ def main():
msg = " ".join(sys.argv[1:]) if len(sys.argv) > 1 else "Update LocalMods"
print()
print("╔════════════════════════════════════╗")
print("║ Prep: mods → tar → commit ║")
print("╚════════════════════════════════════╝")
print("╔═══════════════════════════════════════╗")
print("║ Prep: mods → rsync → config → commit║")
print("╚═══════════════════════════════════════╝")
print()
log_info("Step 1/4: Copy mods from workshop...")
@@ -36,12 +37,13 @@ def main():
log_ok("LocalMods ready")
print()
log_info("Step 2/4: Taring LocalMods/...")
if os.path.exists(TAR_PATH):
os.remove(TAR_PATH)
subprocess.run(["tar", "-czf", TAR_PATH, "-C", BASE, "LocalMods"], check=True)
size = os.path.getsize(TAR_PATH)
log_ok(f"Created {TAR_PATH} ({size / 1024:.1f} KB)")
log_info("Step 2/4: Rsyncing LocalMods/ to server...")
subprocess.run([
"rsync", "-avz", "--delete",
"-e", "ssh -p 22",
LOCALMODS_DIR + "/", RSYNC_DEST
], check=True)
log_ok("LocalMods synced to homelabvm")
print()
log_info("Step 3/4: Generating config_player.xml...")