23 lines
850 B
Python
23 lines
850 B
Python
import paramiko
|
|
|
|
ssh = paramiko.SSHClient()
|
|
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
|
ssh.connect('140.44.4.41', username='root', key_filename=r'C:\Users\Snarf\.ssh\id_ed25519_snarfnet', timeout=10)
|
|
|
|
def run(cmd):
|
|
print(f"=== {cmd} ===")
|
|
_, out, err = ssh.exec_command(cmd)
|
|
res = out.read().decode().strip()
|
|
errors = err.read().decode().strip()
|
|
if res:
|
|
print(res)
|
|
if errors:
|
|
print("ERR:", errors)
|
|
|
|
print("[*] Upgrading Homepage Dashboard to v1.4.5 on Spaceport...")
|
|
run("kubectl set image deployment/homepage-2-1744068158 homepage-2-1744068158=ghcr.io/gethomepage/homepage:v1.4.5 -n infrastructure")
|
|
run("kubectl rollout status deployment/homepage-2-1744068158 -n infrastructure --timeout=180s")
|
|
run("kubectl get pods -n infrastructure -l app.kubernetes.io/name=homepage -o wide")
|
|
ssh.close()
|
|
|