最初版本
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import os
|
||||
import time
|
||||
import paramiko
|
||||
|
||||
pw = os.environ["DEPLOY_PASSWORD"]
|
||||
c = paramiko.SSHClient()
|
||||
c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
||||
c.connect("20.191.152.26", username="wakka", password=pw, timeout=30)
|
||||
|
||||
cmds = [
|
||||
"sudo docker ps --filter name=guest-chat --format '{{.Status}}'",
|
||||
"sudo docker logs guest-chat --tail 40 2>&1",
|
||||
"sleep 30; curl -sI http://127.0.0.1:7777/guest-customer-service | head -3",
|
||||
]
|
||||
|
||||
for cmd in cmds:
|
||||
print("===", cmd[:80])
|
||||
_, o, e = c.exec_command(cmd, timeout=90)
|
||||
print(o.read().decode()[:2500])
|
||||
err = e.read().decode()
|
||||
if err.strip():
|
||||
print("ERR:", err[:200])
|
||||
|
||||
c.close()
|
||||
Reference in New Issue
Block a user