Compare commits
2 Commits
96385d85a8
...
eb5af0f243
| Author | SHA1 | Date | |
|---|---|---|---|
| eb5af0f243 | |||
| d341cccc8a |
@@ -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")
|
|
||||||
|
|||||||
@@ -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">
|
||||||
|
|||||||
Reference in New Issue
Block a user