Files
git.stella-ops.org/devops/services/console/seed_playwright.sh
2025-12-26 18:11:06 +02:00

23 lines
688 B
Bash

#!/usr/bin/env bash
set -euo pipefail
# Seeds the Playwright browser cache for offline console CI runs.
# Run on a connected runner once, then bake ~/.cache/ms-playwright into the runner image.
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
pushd "$ROOT/src/Web" >/dev/null
if ! command -v npx >/dev/null; then
echo "npx not found; install Node.js 20+ first" >&2
exit 1
fi
echo "Installing Playwright Chromium to ~/.cache/ms-playwright ..."
PLAYWRIGHT_BROWSERS_PATH=${PLAYWRIGHT_BROWSERS_PATH:-~/.cache/ms-playwright}
export PLAYWRIGHT_BROWSERS_PATH
npx playwright install chromium --with-deps
echo "Done. Cache directory: $PLAYWRIGHT_BROWSERS_PATH"
popd >/dev/null