feat: transfer wowmine to neuro

This commit is contained in:
2026-11-20 10:52:59 +00:00
parent f69752dcc0
commit 53d4ecc2bf
66 changed files with 1319 additions and 425 deletions
+13 -30
View File
@@ -1,15 +1,14 @@
#!/usr/bin/env python3
"""Build and publish the same tested server pack on both independent entry points."""
"""Compatibility command: build and publish the tested server pack on neuro."""
import argparse
import hashlib
from pathlib import Path
import subprocess
import sys
import tempfile
import zipfile
def main():
def main() -> None:
ap = argparse.ArgumentParser(description=__doc__)
ap.add_argument('mrpack', type=Path)
ap.add_argument('--bootstrap', type=Path)
@@ -20,37 +19,21 @@ def main():
deployed = subprocess.run([
'ssh', '-o', 'BatchMode=yes', 'neuro',
'systemctl is-active --quiet minecraft-server-wowMineMap && '
'sha256sum /var/lib/minecraft-modpacks/worldOfSosal/WorldOfSosal.mrpack',
'sha256sum /var/lib/minecraft-modpacks/wowmine/wowmine.mrpack',
], capture_output=True, text=True, check=True).stdout.split()[0]
if deployed != expected:
ap.error('Deploy this mrpack on neuro first: the server archive hash differs')
scripts = Path(__file__).resolve().parent
mirrors = [
('hectic-lab', 'https://store.hectic-lab.com/minecraft/world-of-sosal/', 'wowmine.bfs.band:35565'),
('bfs.poland.xray', 'https://store.bfs.band/minecraft/world-of-sosal/', 'wowmine.bfs.band:35565'),
]
with tempfile.TemporaryDirectory(prefix='prism-mirrors-') as temporary:
root = Path(temporary)
bootstrap = args.bootstrap.resolve() if args.bootstrap else None
builds = []
for host, url, server in mirrors:
output = root / host
command = [sys.executable, str(scripts / 'build-prism-pack.py'),
str(archive), str(output), '--base-url', url, '--server', server]
if bootstrap:
command += ['--bootstrap', str(bootstrap)]
subprocess.run(command, check=True)
if bootstrap is None:
bootstrap = root / 'packwiz-installer-bootstrap.jar'
with zipfile.ZipFile(output / 'WorldOfSosal-Prism.zip') as z:
bootstrap.write_bytes(z.read('.minecraft/packwiz-installer-bootstrap.jar'))
builds.append((host, url, output))
# Each switch is atomic on its host. A failed publication exits nonzero;
# rerunning safely verifies existing releases and retries both mirrors.
for host, url, output in builds:
subprocess.run([sys.executable, str(scripts / 'publish-prism-pack.py'),
str(output), host], check=True)
print(url, flush=True)
with tempfile.TemporaryDirectory(prefix='prism-publish-') as temporary:
output = Path(temporary) / 'export'
command = [sys.executable, str(scripts / 'build-prism-pack.py'),
str(archive), str(output), '--server', 'wowmine.bfs.band:35565']
if args.bootstrap:
command += ['--bootstrap', str(args.bootstrap.resolve())]
subprocess.run(command, check=True)
subprocess.run([sys.executable, str(scripts / 'publish-prism-pack.py'),
str(output)], check=True)
print('https://wowmine.bfs.band:8443/minecraft/wowmine/', flush=True)
if __name__ == '__main__':