Update deploy script to include dev dependencies during npm installation for backend builds, enhancing reliability of npm ci commands. Adjust fallback mechanism to remove --omit=dev flag for consistent dependency management.

This commit is contained in:
Torsten Schulz (local)
2025-10-20 10:00:30 +02:00
parent b16a09059f
commit 1f20500b5f

View File

@@ -202,10 +202,10 @@ setup_backend() {
npm config set audit false >/dev/null 2>&1 || true npm config set audit false >/dev/null 2>&1 || true
npm config set progress false >/dev/null 2>&1 || true npm config set progress false >/dev/null 2>&1 || true
npm config set loglevel warn >/dev/null 2>&1 || true npm config set loglevel warn >/dev/null 2>&1 || true
# Schnelle, reproduzierbare Installation nur Prod-Dependencies # Backend braucht alle Dependencies (auch dev für Build-Tools)
timeout 600 bash -lc "npm ci --omit=dev --no-audit --no-fund --silent --loglevel=warn --no-progress" || { timeout 600 bash -lc "npm ci --no-audit --no-fund --silent --loglevel=warn --no-progress" || {
print_warning "npm ci ist fehlgeschlagen oder hat zu lange gedauert. Versuche fallback ohne timeout..." print_warning "npm ci ist fehlgeschlagen oder hat zu lange gedauert. Versuche fallback ohne timeout..."
npm ci --omit=dev --no-audit --no-fund --silent --loglevel=warn --no-progress || { npm ci --no-audit --no-fund --silent --loglevel=warn --no-progress || {
print_error "npm ci (Backend) fehlgeschlagen"; exit 1; print_error "npm ci (Backend) fehlgeschlagen"; exit 1;
} }
} }
@@ -491,9 +491,10 @@ do_update() {
npm config set audit false >/dev/null 2>&1 || true npm config set audit false >/dev/null 2>&1 || true
npm config set progress false >/dev/null 2>&1 || true npm config set progress false >/dev/null 2>&1 || true
npm config set loglevel warn >/dev/null 2>&1 || true npm config set loglevel warn >/dev/null 2>&1 || true
timeout 600 bash -lc "npm ci --omit=dev --no-audit --no-fund --silent --loglevel=warn --no-progress" || { # Backend braucht alle Dependencies (auch dev für Build-Tools)
timeout 600 bash -lc "npm ci --no-audit --no-fund --silent --loglevel=warn --no-progress" || {
print_warning "npm ci ist fehlgeschlagen oder hat zu lange gedauert. Versuche fallback ohne timeout..." print_warning "npm ci ist fehlgeschlagen oder hat zu lange gedauert. Versuche fallback ohne timeout..."
npm ci --omit=dev --no-audit --no-fund --silent --loglevel=warn --no-progress || { npm ci --no-audit --no-fund --silent --loglevel=warn --no-progress || {
print_error "npm ci (Backend Update) fehlgeschlagen"; exit 1; print_error "npm ci (Backend Update) fehlgeschlagen"; exit 1;
} }
} }