24190bf679
Co-authored-by: Cursor <cursoragent@cursor.com>
27 lines
806 B
Python
27 lines
806 B
Python
"""Deploy trend callback period + rich preview."""
|
|
import paramiko
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
sys.stdout.reconfigure(encoding="utf-8", errors="replace")
|
|
root = Path(__file__).resolve().parents[1]
|
|
files = [
|
|
"strategy/strategy_trend_lib.py",
|
|
"strategy/strategy_db.py",
|
|
"install_trading.py",
|
|
"templates/strategy.html",
|
|
"static/js/strategy.js",
|
|
]
|
|
|
|
c = paramiko.SSHClient()
|
|
c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
|
c.connect("192.168.8.21", username="root", password="woaini88", timeout=15)
|
|
sftp = c.open_sftp()
|
|
for rel in files:
|
|
sftp.put(str(root / rel), f"/opt/qihuo/{rel.replace(chr(92), '/')}")
|
|
print("uploaded", rel)
|
|
sftp.close()
|
|
_, o, _ = c.exec_command("cd /opt/qihuo && pm2 restart qihuo")
|
|
print(o.read().decode("utf-8", errors="replace"))
|
|
c.close()
|