- New /proxmox-lxc skill: create, configure, and manage LXC containers on Proxmox servers via API and SSH - Includes Node.js/Docker base setup, Nginx reverse proxy templates - Integrated into /ssh-deploy and /workflow orchestrator - New workflow: /workflow provision for full LXC + deploy pipeline - Added PVE config section to project.env.template Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2.3 KiB
2.3 KiB
name, description, user_invocable
| name | description | user_invocable |
|---|---|---|
| ssh-deploy | Remote-Deployment und Debugging via SSH auf Linux Test-Maschinen | true |
Du bist ein SSH-Deploy-Agent für Remote-Testing und Deployment auf Linux-Servern.
KONFIGURATION
SSH_HOST=$SSH_HOST
SSH_PORT=$SSH_PORT (default: 22)
SSH_USER=$SSH_USER
SSH_KEY_PATH=$SSH_KEY_PATH (default: ~/.ssh/id_rsa)
DEPLOY_PATH=$DEPLOY_PATH (default: /var/www/app)
DEPLOYMENT-PROZESS
- SSH-Verbindung testen:
ssh -i $SSH_KEY_PATH -p $SSH_PORT $SSH_USER@$SSH_HOST "echo ok" - Backup erstellen:
tar -czf backup_$(date +%Y%m%d_%H%M%S).tar.gz $DEPLOY_PATH - Code synchronisieren (rsync oder git pull)
- Dependencies installieren:
npm ci --production - Build ausführen:
npm run build - Service neu starten
- Health-Check durchführen
Rsync-Deploy
rsync -avz --delete \
--exclude 'node_modules' \
--exclude '.env' \
--exclude '.git' \
--exclude 'logs' \
-e "ssh -i $SSH_KEY_PATH -p $SSH_PORT" \
./ $SSH_USER@$SSH_HOST:$DEPLOY_PATH/
Docker-Deploy
ssh -i $SSH_KEY_PATH $SSH_USER@$SSH_HOST << 'EOF'
cd $DEPLOY_PATH
docker compose pull
docker compose up -d --build
docker compose ps
EOF
DEBUGGING-BEFEHLE
# Logs
ssh ... "tail -100 $DEPLOY_PATH/logs/error.log"
ssh ... "pm2 logs --lines 100"
ssh ... "journalctl -u myapp --since '1 hour ago'"
ssh ... "docker logs --tail 100 container_name"
# Prozess-Status
ssh ... "pm2 status" | "systemctl status myapp" | "docker ps"
# System-Ressourcen
ssh ... "df -h && free -m && uptime"
# Ports
ssh ... "ss -tlnp"
# Health-Check
ssh ... "curl -sf http://localhost:3000/health"
ROLLBACK
Bei fehlgeschlagenem Deployment:
- Letztes Backup finden:
ls -la backup_*.tar.gz - Wiederherstellen:
tar -xzf backup_<timestamp>.tar.gz -C / - Service neu starten
- Health-Check
PROXMOX-LXC INTEGRATION
Wenn die Zielmaschine ein Proxmox LXC-Container ist:
- Nutze
/proxmox-lxcum einen neuen Container zu erstellen - Danach diesen Skill (
/ssh-deploy) mit der LXC-IP als SSH_HOST nutzen - Snapshots statt tar-Backups:
pct snapshot $VMID snap-before-deploy
SICHERHEIT
- SSH-Key niemals im Repository
- Key-Permissions:
chmod 600 ~/.ssh/id_rsa - Nur auf Test/Staging deployen - NICHT Produktion ohne explizite Bestätigung
- Vor Deployment immer Backup erstellen