Compare commits

...

2 Commits

Author SHA1 Message Date
eb5af0f243 fix: trying to fix auto-pulls 14 ! 2026-02-27 05:46:44 +02:00
d341cccc8a fix: trying to fix auto-pulls 13 ! 2026-02-27 05:45:18 +02:00
2 changed files with 11 additions and 17 deletions

View File

@@ -50,21 +50,15 @@ async def deploy(request: Request):
f"git reset --hard origin/main && " f"git reset --hard origin/main && "
f"docker-compose up -d --build" f"docker-compose up -d --build"
) )
try:
proc = await asyncio.create_subprocess_shell(
cmd,
stdout=asyncio.subprocess.PIPE,
stderr=asyncio.subprocess.STDOUT,
)
stdout, _ = await asyncio.wait_for(proc.communicate(), timeout=300)
output = stdout.decode(errors="replace") if stdout else ""
if proc.returncode != 0: # Fire and forget — run deploy in background so we can respond before
logger.error(f"Deploy failed (exit {proc.returncode}):\n{output}") # the container restarts (which would kill this very process).
raise HTTPException(status_code=500, detail=f"Deploy script failed:\n{output[-500:]}") await asyncio.create_subprocess_shell(
cmd,
stdout=asyncio.subprocess.DEVNULL,
stderr=asyncio.subprocess.DEVNULL,
start_new_session=True,
)
logger.info(f"Deploy succeeded:\n{output[-300:]}") logger.info("Auto-deploy started in background")
return {"ok": True, "output": output[-1000:]} return {"ok": True, "message": "Deploy started"}
except asyncio.TimeoutError:
raise HTTPException(status_code=504, detail="Deploy timed out after 300 seconds")

View File

@@ -12,7 +12,7 @@ export default function Header() {
}} }}
> >
<h2 className="text-lg font-semibold" style={{ color: "var(--text-heading)" }}> <h2 className="text-lg font-semibold" style={{ color: "var(--text-heading)" }}>
BellCloud - Console 2 BellCloud - Console 3
</h2> </h2>
<div className="flex items-center gap-4"> <div className="flex items-center gap-4">