fix(tools-pve/asr-pipeline): support /state/vault and /state/ssh inside container
Build image / build (push) Canceled after 0s
Build ASR Pipeline / image (push) Canceled after 0s

This commit is contained in:
Codex
2026-11-02 03:07:41 -08:00
parent bf5ea57d99
commit 9debd1c47d
2 changed files with 32 additions and 3 deletions
@@ -10,6 +10,7 @@ Ported from the legacy shell implementation with its hard-won details preserved:
"""
from __future__ import annotations
import os
import re
import subprocess
import tempfile
@@ -90,10 +91,23 @@ def update_pending(date: str, title: str, path: Path) -> None:
def _git(*args, check=False) -> subprocess.CompletedProcess:
env = dict(os.environ)
for key_candidate in (
CFG.state_dir / "ssh" / "id_ed25519_gitea",
Path("/state/ssh/id_ed25519_gitea"),
Path("/root/.ssh/id_ed25519_gitea"),
Path.home() / ".ssh" / "id_ed25519_gitea",
):
if key_candidate.exists():
env.setdefault(
"GIT_SSH_COMMAND",
f"ssh -i {key_candidate} -o StrictHostKeyChecking=accept-new -o IdentitiesOnly=yes",
)
break
return subprocess.run(
["git", "-c", f"safe.directory={CFG.vault}", *args],
cwd=CFG.vault, capture_output=True,
text=True, timeout=180, check=check,
text=True, timeout=180, check=check, env=env,
)