Refactor deploy script to add 'no-backup' option for updates, allowing users to skip database backups during code updates. Update help text for clarity on available options and improve overall script usability.

This commit is contained in:
Torsten Schulz (local)
2026-05-14 16:34:25 +02:00
parent 83305c0940
commit 7d5c8cffc7
3 changed files with 54 additions and 38 deletions

View File

@@ -9,13 +9,14 @@
# ./deploy.sh [OPTION]
#
# Optionen:
# install - Erste Installation (inkl. System-Setup)
# update - Update einer bestehenden Installation
# rollback - Rollback zur vorherigen Version
# backup - Erstelle Backup der Datenbank
# status - Zeige Status der Services
# logs - Zeige Logs
# help - Zeige diese Hilfe
# install - Erste Installation (inkl. System-Setup)
# update - Update einer bestehenden Installation
# update no-backup - Update ohne Backup (nur Code-Update)
# rollback - Rollback zur vorherigen Version
# backup - Erstelle Backup der Datenbank
# status - Zeige Status der Services
# logs - Zeige Logs
# help - Zeige diese Hilfe
#
# =============================================================================
@@ -459,8 +460,13 @@ do_update() {
print_info "Quell-Verzeichnis: $CURRENT_DIR"
print_info "Ziel-Verzeichnis: $PROJECT_DIR"
# Backup erstellen
do_backup
# Backup erstellen (nur wenn nicht explizit übersprungen)
SKIP_BACKUP="${2:-false}"
if [ "$SKIP_BACKUP" != "no-backup" ]; then
do_backup
else
print_info "Backup übersprungen (--no-backup Flag gesetzt)"
fi
# Kopiere aktualisierte Dateien
print_header "Kopiere aktualisierte Dateien"
@@ -767,19 +773,21 @@ $PROJECT_NAME v3 - Deployment Script
Verwendung: $0 [OPTION]
Optionen:
install Erste Installation (inkl. System-Setup)
update Update einer bestehenden Installation
rollback Rollback zur vorherigen Version
backup Erstelle Backup der Datenbank
status Zeige Status der Services
logs Zeige Logs
help Zeige diese Hilfe
install Erste Installation (inkl. System-Setup)
update Update einer bestehenden Installation
update no-backup Update ohne Backup (nur Code-Update, keine DB-Berührung)
rollback Rollback zur vorherigen Version
backup Erstelle Backup der Datenbank
status Zeige Status der Services
logs Zeige Logs
help Zeige diese Hilfe
Beispiele:
$0 install # Erste Installation
$0 update # Update durchführen
$0 backup # Backup erstellen
$0 status # Status anzeigen
$0 install # Erste Installation
$0 update # Update durchführen (mit Backup)
$0 update no-backup # Nur Code-Update, kein Backup
$0 backup # Backup erstellen
$0 status # Status anzeigen
EOF
}
@@ -790,7 +798,7 @@ case "${1:-help}" in
do_install
;;
update)
do_update
do_update "$@"
;;
rollback)
do_rollback