From b941c5db51986ae0942f70b52177ea7015d65eb1 Mon Sep 17 00:00:00 2001 From: Patrick Date: Fri, 5 Jun 2026 19:43:00 +0200 Subject: [PATCH] Refactor: Deploy-Skripte bereinigt (Next.js/deploy/-Referenzen entfernt) 4 veraltete Skripte durch 2 einfache ersetzt: deploy-test.sh + deploy-pi.sh Co-Authored-By: Claude Sonnet 4.6 --- deploy-pi.sh | 5 +++++ deploy-test.sh | 5 +++++ deploy.sh | 45 -------------------------------------------- update-179.sh | 51 -------------------------------------------------- update-pi.sh | 3 --- update-test.sh | 3 --- 6 files changed, 10 insertions(+), 102 deletions(-) create mode 100755 deploy-pi.sh create mode 100755 deploy-test.sh delete mode 100755 deploy.sh delete mode 100644 update-179.sh delete mode 100755 update-pi.sh delete mode 100755 update-test.sh diff --git a/deploy-pi.sh b/deploy-pi.sh new file mode 100755 index 0000000..011aee1 --- /dev/null +++ b/deploy-pi.sh @@ -0,0 +1,5 @@ +#!/bin/bash +# Deploy auf Raspberry Pi (10.66.120.3) +set -e +rsync -a backend/ root@10.66.120.3:/opt/zfs-manager/backend/ +ssh root@10.66.120.3 'systemctl restart zfs-manager-backend && systemctl is-active zfs-manager-backend' diff --git a/deploy-test.sh b/deploy-test.sh new file mode 100755 index 0000000..fc0e3c1 --- /dev/null +++ b/deploy-test.sh @@ -0,0 +1,5 @@ +#!/bin/bash +# Deploy auf Test-Container (192.168.1.179) +set -e +rsync -a backend/ root@192.168.1.179:/opt/zmb-webui/backend/ +ssh root@192.168.1.179 'systemctl restart zmb-webui-backend && systemctl is-active zmb-webui-backend' diff --git a/deploy.sh b/deploy.sh deleted file mode 100755 index 7b2b52b..0000000 --- a/deploy.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/bash -# Deploy ZMB Webui to target system -# Usage: ./deploy.sh [target] [--pull] -# Example: ./deploy.sh 192.168.1.179 -# Example: ./deploy.sh 192.168.1.179 --pull (pull from git first) - -TARGET="${1:-192.168.1.179}" -PULL="${2:-}" - -set -e - -if [ "$PULL" == "--pull" ]; then - echo "πŸ“¦ Pulling from git..." - git pull origin master -fi - -echo "πŸ”¨ Building frontend..." -cd frontend -rm -rf .next out -npm run build > /dev/null 2>&1 -cd .. - -echo "πŸ“€ Deploying to $TARGET..." - -# Deploy backend -echo " β†’ Backend..." -rsync -avz --delete backend/ root@$TARGET:/opt/zmb-webui/backend/ \ - --exclude venv --exclude __pycache__ --exclude "*.pyc" > /dev/null - -# Deploy frontend -echo " β†’ Frontend..." -rsync -avz --delete frontend/out/ root@$TARGET:/opt/zmb-webui/frontend/ > /dev/null - -# Restart services -echo "πŸ”„ Restarting services..." -ssh root@$TARGET bash << 'EOF' -systemctl restart zmb-webui-backend -sleep 1 -systemctl restart nginx -sleep 1 -echo "βœ“ Services restarted" -EOF - -echo "βœ… Deployment complete!" -echo " Access: https://$TARGET:8090" diff --git a/update-179.sh b/update-179.sh deleted file mode 100644 index 5cb0fc3..0000000 --- a/update-179.sh +++ /dev/null @@ -1,51 +0,0 @@ -#!/bin/bash -# ZMB Webui Updater fΓΌr 192.168.1.179 -# Buildet Frontend neu und deployt alles - -set -e - -CONTAINER="192.168.1.179" -BACKEND_PATH="/opt/zmb-webui/backend" -FRONTEND_PATH="/opt/zmb-webui/frontend" - -echo "πŸ”„ ZMB Webui Update fΓΌr $CONTAINER" -echo "" - -# 1. Backend Files -echo "πŸ“¦ Backend updaten..." -scp backend/services/shares.py root@$CONTAINER:$BACKEND_PATH/services/ > /dev/null 2>&1 -scp backend/routers/navigator.py root@$CONTAINER:$BACKEND_PATH/routers/ > /dev/null 2>&1 -scp backend/routers/shares.py root@$CONTAINER:$BACKEND_PATH/routers/ > /dev/null 2>&1 -scp backend/main.py root@$CONTAINER:$BACKEND_PATH/ > /dev/null 2>&1 -echo " βœ“ Backend files" - -# 2. Frontend bauen -echo "πŸ“¦ Frontend bauen..." -cd frontend -rm -rf out .next 2>/dev/null || true -npm run build > /dev/null 2>&1 -echo " βœ“ Frontend gebaut" - -# 3. Frontend deployen -echo "πŸ“¦ Frontend deployen..." -scp -r out/* root@$CONTAINER:$FRONTEND_PATH/ > /dev/null 2>&1 -echo " βœ“ Frontend hochgeladen" -cd .. - -# 4. Services restarren -echo "πŸ”„ Services neustarten..." -ssh root@$CONTAINER "systemctl restart zmb-webui-backend" > /dev/null 2>&1 -sleep 2 -ssh root@$CONTAINER "systemctl restart nginx" > /dev/null 2>&1 -echo " βœ“ Backend restarted" -echo " βœ“ Nginx restarted" - -# 5. Status prΓΌfen -echo "" -echo "βœ… Update complete!" -echo "" -ssh root@$CONTAINER "systemctl status zmb-webui-backend nginx | grep -E 'Active:|running'" | while read line; do echo " $line"; done - -echo "" -echo "🌐 Zugang: http://$CONTAINER:8090" -echo "" diff --git a/update-pi.sh b/update-pi.sh deleted file mode 100755 index 653f455..0000000 --- a/update-pi.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -# Quick update fΓΌr Production Pi (10.66.120.3) -bash deploy/update-from-gitea.sh master pi diff --git a/update-test.sh b/update-test.sh deleted file mode 100755 index 409c893..0000000 --- a/update-test.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -# Quick update fΓΌr Test-Container (192.168.1.179) -bash deploy/update-from-gitea.sh master 179