Files
exposedgays/deploy/check-deploy-err.py

28 lines
1020 B
Python

#!/usr/bin/env python3
import paramiko
c = paramiko.SSHClient()
c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
c.connect("10.10.0.10", username="localadministrator", password="Bbt9115xty9176!", timeout=20, allow_agent=False, look_for_keys=False)
_, o, e = c.exec_command(
"docker exec coolify-db psql -U coolify -d coolify -t -A -c "
'"SELECT id,status FROM application_deployment_queues ORDER BY id DESC LIMIT 3;"',
timeout=60,
)
o.channel.recv_exit_status()
print((o.read() + e.read()).decode())
_, o, e = c.exec_command(
"docker exec coolify-db psql -U coolify -d coolify -t -A -c "
'"SELECT logs FROM application_deployment_queues ORDER BY id DESC LIMIT 1;"',
timeout=120,
)
o.channel.recv_exit_status()
raw = (o.read() + e.read()).decode()
for needle in ["Failed to compile", "Type error", "error TS", "Module not found", "Cannot find", "Error:"]:
idx = raw.rfind(needle)
if idx >= 0:
print("\n===", needle, "===\n")
print(raw[idx : idx + 3500])
c.close()