build logs via tmux

This commit is contained in:
2025-08-02 00:34:31 -04:00
parent 0ec669f99e
commit fb7117b292
3 changed files with 15 additions and 5 deletions

View File

@@ -3,7 +3,6 @@ from dataclasses import dataclass
import subprocess
import os
from time import time
from textwrap import dedent
@dataclass
@@ -47,10 +46,17 @@ def handle_request(rq: DeployerRequest):
build_log = f"{logs_dir}/build.log"
subprocess.Popen(
["./deploy.sh"],
[
"tmux",
"new-session",
"-d",
"-s",
f"{domain}-build-{deployment_id}",
"sh",
"-c",
f"/path/to/build.sh > {build_log} 2>&1",
],
user="root",
stdout=open(build_log, "w"),
stderr=open(build_log, "a"),
shell=True,
env=dict(
os.environ,