Adding fixes to the publish pipeline

This commit is contained in:
2026-05-09 15:36:15 +02:00
parent 00e01237ed
commit 2dff8f45b9
5 changed files with 298 additions and 108 deletions
+25 -10
View File
@@ -50,7 +50,7 @@ Examples:
gnommo -p video1 transcode --processed --alpha-quality 0.5 More aggressive alpha compression
gnommo -p video1 transcode --processed --dry-run Preview what would be compressed
gnommo -p video1 transcode --force Re-transcode even if output already exists
gnommo -p video1 all Full pipeline: import → preprocess → trim → stitch → render → handoff
gnommo -p video1 all Full pipeline: down → import → preprocess → trim → stitch → render → push → handoff → up
gnommo -p video1 render --dry-run Show FFmpeg command without running
gnommo -p video1 description Generate YouTube description file
gnommo -p video1 transcribe Narration file for timing of slides
@@ -2836,21 +2836,27 @@ def cmd_all(
res: str = "full",
force: bool = False,
) -> int:
"""Run full pipeline: import → preprocess → trim → stitch → render → handoff.
"""Run full pipeline: down → import → preprocess → trim → stitch → render → push → handoff → up.
Cascade rule: if any stage produces output, all subsequent stages are forced
to re-run (cascade_force=True), regardless of whether --force was passed.
This ensures downstream caches are always consistent with upstream changes.
"""
from .handoff import cmd_handoff
from .push import cmd_push
print(f"=== Full Pipeline: {project_path.name} ===\n")
print(">>> Step 1/9: Download\n")
result = cmd_sync(project_path, verbose, dry_run, download=True)
if result != 0:
return result
# cascade_force starts at --force. Once any stage does real work it flips to
# True so all downstream stages re-run unconditionally.
cascade_force = force
print(">>> Step 1/6: Import\n")
print("\n>>> Step 2/9: Import\n")
t0 = time.time()
result = cmd_import(project_path, cascade_force, verbose)
if result != 0:
@@ -2860,7 +2866,7 @@ def cmd_all(
):
cascade_force = True
print("\n>>> Step 2/6: Preprocess\n")
print("\n>>> Step 3/9: Preprocess\n")
t0 = time.time()
result = cmd_preprocess(
project_path, verbose, dry_run, cascade_force, workers=1, res=res
@@ -2872,7 +2878,7 @@ def cmd_all(
) or _files_modified_since(project_path, t0, "*_processed.webm"):
cascade_force = True
print("\n>>> Step 3/6: Trim\n")
print("\n>>> Step 4/9: Trim\n")
t0 = time.time()
result = cmd_trim(project_path, verbose, force=cascade_force, threshold_db=-40.0)
if result != 0:
@@ -2881,7 +2887,7 @@ def cmd_all(
if _files_modified_since(project_path, t0, "narration.json"):
cascade_force = True
print("\n>>> Step 4/6: Stitch\n")
print("\n>>> Step 5/9: Stitch\n")
t0 = time.time()
result = cmd_stitch(project_path, verbose, cascade_force, res=res)
if result != 0:
@@ -2889,13 +2895,23 @@ def cmd_all(
if _files_modified_since(project_path, t0, "narration_combined.mov"):
cascade_force = True
print("\n>>> Step 5/6: Render\n")
print("\n>>> Step 6/9: Render\n")
result = cmd_render(project_path, verbose, dry_run, res=res, force=cascade_force)
if result != 0:
return result
print("\n>>> Step 6/6: Handoff\n")
return cmd_handoff(project_path, verbose, file_override=None, prod=False, res=res)
print("\n>>> Step 7/9: Push\n")
result = cmd_push(project_path, verbose, force=False, prod=True)
if result != 0:
return result
print("\n>>> Step 8/9: Handoff\n")
result = cmd_handoff(project_path, verbose, file_override=None, prod=True, res=res)
if result != 0:
return result
print("\n>>> Step 9/9: Upload\n")
return cmd_sync(project_path, verbose, dry_run, download=False)
# =============================================================================
@@ -3214,7 +3230,6 @@ def cmd_sync(project_path: Path, verbose: bool, dry_run: bool, download: bool) -
print(f"Error: could not create remote directory {remote_dir}")
return 1
rsync_cmd = [
"rsync",
"-av",