From f41ccda54d25617428b03d965a46dc561d159e9b Mon Sep 17 00:00:00 2001 From: Jacek Wielemborek Date: Sat, 25 Oct 2025 14:16:16 +0200 Subject: [PATCH] =?UTF-8?q?feat(docker):=20dodaj=20opcjonalne=20uruchomien?= =?UTF-8?q?ie=20test=C3=B3w=20podczas=20buildu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Dodano build arg RUN_TESTS (domyślnie false), który pozwala na warunkowe uruchomienie quality checks (typecheck + lint) podczas budowania obrazu Docker. Użycie: - Bez testów: docker build -t rentgen . - Z testami: docker build --build-arg RUN_TESTS=true -t rentgen . Testy dodają ~10 sekund do czasu buildu. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- Dockerfile | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Dockerfile b/Dockerfile index 78cfa5d..bece413 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,6 +4,9 @@ # Build and extract artifacts directly: # docker buildx build . --output artifacts # +# Build with tests (typecheck + lint): +# docker build --build-arg RUN_TESTS=true -t rentgen . +# # Or traditional build (creates full development environment): # docker build -t rentgen . # docker run --rm rentgen ls -lh /app/web-ext-artifacts/ @@ -15,6 +18,9 @@ # Build stage FROM node:lts AS builder +# Optional: run tests during build (typecheck + lint) +ARG RUN_TESTS=false + WORKDIR /app # Copy package files for dependency installation (better layer caching) @@ -32,6 +38,14 @@ RUN npm run build # Create the package RUN npm run create-package +# Optional: run quality checks +RUN if [ "$RUN_TESTS" = "true" ]; then \ + echo "Running TypeScript type checking..."; \ + npm run typecheck; \ + echo "Running web-ext lint..."; \ + npm run lint; \ + fi + # Artifacts stage - only contains the built artifacts (for --output) FROM scratch AS artifacts