diff --git a/deploy-production.sh b/deploy-production.sh index 2324f48..34ef61e 100755 --- a/deploy-production.sh +++ b/deploy-production.sh @@ -102,6 +102,18 @@ install_dependencies_if_needed() { printf '%s\n' "$current_lock_hash" > "$lock_hash_file" } +install_playwright_browser() { + if [ ! -d "node_modules/playwright" ]; then + echo " Playwright ist nicht installiert; Browser-Installation wird übersprungen" + return 0 + fi + + # Muss mit demselben Benutzer laufen, der später den PM2-Prozess startet; + # Playwright legt den Browser im benutzerspezifischen Cache ab. + echo " Installing/verifying Playwright Chromium browser..." + npx playwright install chromium +} + use_project_node() { export NVM_DIR="${NVM_DIR:-$HOME/.nvm}" if [ -s "$NVM_DIR/nvm.sh" ]; then @@ -278,6 +290,7 @@ echo "3. Installing dependencies..." use_project_node ensure_node_version install_dependencies_if_needed +install_playwright_browser # 4. Stop running apps before replacing build artifacts echo "" diff --git a/deploy-test.sh b/deploy-test.sh index 307ec60..e6da5f5 100755 --- a/deploy-test.sh +++ b/deploy-test.sh @@ -115,6 +115,18 @@ install_dependencies_if_needed() { printf '%s\n' "$current_lock_hash" > "$lock_hash_file" } +install_playwright_browser() { + if [ ! -d "node_modules/playwright" ]; then + echo " Playwright ist nicht installiert; Browser-Installation wird übersprungen" + return 0 + fi + + # Muss mit demselben Benutzer laufen, der später den PM2-Prozess startet; + # Playwright legt den Browser im benutzerspezifischen Cache ab. + echo " Installing/verifying Playwright Chromium browser..." + npx playwright install chromium +} + use_project_node() { export NVM_DIR="${NVM_DIR:-$HOME/.nvm}" if [ -s "$NVM_DIR/nvm.sh" ]; then @@ -284,6 +296,7 @@ echo "3. Installing dependencies..." use_project_node ensure_node_version install_dependencies_if_needed +install_playwright_browser # 4. Stop running app before replacing build artifacts echo ""