From 4dca2af645bfcb32d44d520890cd223047f9a56b Mon Sep 17 00:00:00 2001 From: "Torsten Schulz (local)" Date: Fri, 4 Sep 2026 14:46:14 +0200 Subject: [PATCH] =?UTF-8?q?F=C3=BCge=20Playwright-Installation=20hinzu:=20?= =?UTF-8?q?=C3=9Cberpr=C3=BCfe=20und=20installiere=20den=20Chromium-Browse?= =?UTF-8?q?r=20in=20den=20Deployment-Skripten?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deploy-production.sh | 13 +++++++++++++ deploy-test.sh | 13 +++++++++++++ 2 files changed, 26 insertions(+) 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 ""