feat: add boot staging configuration and automation utility scripts

This commit is contained in:
2026-11-02 14:09:13 -05:00
parent 08d085b95f
commit 90977592ab
26 changed files with 773 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
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)
with open('snarfcode_update.bundle', 'rb') as f:
bundle_data = f.read()
stdin, stdout, stderr = ssh.exec_command('cat > /tmp/snarfcode_update.bundle')
stdin.write(bundle_data)
stdin.close()
stdout.read()
print("Bundle piped to /tmp/snarfcode_update.bundle on 140.44.4.41")
cmds = [
"RUNNING_POD=$(kubectl get pod -n infrastructure -l app=gitea --field-selector status.phase=Running -o jsonpath='{.items[0].metadata.name}') && kubectl cp /tmp/snarfcode_update.bundle infrastructure/${RUNNING_POD}:/tmp/snarfcode_update.bundle -c gitea",
"kubectl exec -n infrastructure deployment/gitea -c gitea -- sh -c 'cd /data/git/gitea-repositories/snarf/snarfcode.git && git fetch /tmp/snarfcode_update.bundle HEAD:alpha && git update-ref refs/heads/alpha FETCH_HEAD && git update-ref refs/heads/main FETCH_HEAD && git log -n 3 --oneline refs/heads/alpha'",
"rm -f /tmp/snarfcode_update.bundle"
]
for cmd in cmds:
print(f">>> {cmd}")
stdin, stdout, stderr = ssh.exec_command(cmd)
print(stdout.read().decode())
err = stderr.read().decode()
if err:
print("STDERR:", err)
ssh.close()