mirror of
https://github.com/johndoe6345789/docker-swarm-termina.git
synced 2026-04-24 13:45:01 +00:00
Fix Dockerfile shell operator precedence bug causing build failures
The e2e test command had incorrect operator precedence: npm run test:e2e || echo "..." && touch marker This was parsed as: npm run test:e2e || (echo "..." && touch marker) Which meant: - If e2e tests PASS → touch never runs → marker file missing → build fails ❌ - If e2e tests FAIL → touch runs → marker file exists → build succeeds ✓ This was backwards\! The production stage expects the marker file at line 64: COPY --from=e2e-test /app/.e2e-tests-passed /tmp/.e2e-tests-passed Fixed by adding parentheses to ensure correct precedence: (npm run test:e2e || echo "...") && touch marker Now the marker file is always created regardless of test outcome, which is the intended behavior for a non-blocking test stage. This fixes the docker-build-test CI failures that occurred after the e2e tests started passing. The build was failing because tests were passing but the marker file wasn't being created. https://claude.ai/code/session_7d4f1b7d-7a0d-44db-b437-c76b6b61dfb2
This commit is contained in:
@@ -52,7 +52,7 @@ COPY . .
|
||||
RUN npm run build
|
||||
|
||||
# Run e2e tests (non-blocking in CI as requires running backend)
|
||||
RUN npm run test:e2e || echo "E2E tests skipped (requires running services)" && touch /app/.e2e-tests-passed
|
||||
RUN (npm run test:e2e || echo "E2E tests skipped (requires running services)") && touch /app/.e2e-tests-passed
|
||||
|
||||
# Production stage
|
||||
FROM node:20-slim AS production
|
||||
|
||||
Reference in New Issue
Block a user