Adds website theme serialization system
This commit is contained in:
@@ -305,6 +305,25 @@ async def _upload_files_to_worker(
|
||||
raise RuntimeError(f"Failed to upload file {row.original_name}: {out}")
|
||||
|
||||
|
||||
async def _upload_theme_to_worker(
|
||||
session: AsyncSession,
|
||||
request: MobileBuildRequest,
|
||||
host: str,
|
||||
) -> None:
|
||||
"""SCP theme.json to the build worker (no-op if file doesn't exist)."""
|
||||
theme_path = Path(settings.THEME_JSON_PATH)
|
||||
if not theme_path.exists():
|
||||
await _append_log(session, request, "[theme] theme.json not found — skipping upload")
|
||||
return
|
||||
|
||||
scp_prefix = _build_scp_prefix(host)
|
||||
remote_target = f"{settings.MOBILE_BUILD_SSH_USER}@{host}:{settings.MOBILE_BUILD_REMOTE_APP_DIR}/theme.json"
|
||||
code, out = await _run_command(scp_prefix + [str(theme_path), remote_target])
|
||||
if code != 0:
|
||||
raise RuntimeError(f"Failed to upload theme.json: {out}")
|
||||
await _append_log(session, request, "[theme] theme.json uploaded to worker")
|
||||
|
||||
|
||||
async def _run_platform_build(
|
||||
session: AsyncSession,
|
||||
request: MobileBuildRequest,
|
||||
@@ -317,6 +336,9 @@ async def _run_platform_build(
|
||||
await _append_log(session, request, f"[{platform}] Uploading {len(platform_files)} file(s) to worker")
|
||||
await _upload_files_to_worker(platform_files, host)
|
||||
|
||||
# Upload theme.json to worker
|
||||
await _upload_theme_to_worker(session, request, host)
|
||||
|
||||
ssh_prefix = _build_ssh_prefix(host)
|
||||
cmd = ssh_prefix + [
|
||||
(
|
||||
|
||||
Reference in New Issue
Block a user