Docker pipeline with Node.js lint/test integration. Runs ESLint and tests before building the Docker image.
Go to Settings > CI/CD > General pipelines and set CI/CD configuration file to:
https://gitlab-ci-yaml-template.enouvo.com/docker/.nodejs.gitlab-ci.yml
include: - 'https://gitlab-ci-yaml-template.enouvo.com/docker/.nodejs.gitlab-ci.yml'
| Variable | Default | Description |
|---|---|---|
NODE_VERSION | 22.22 | Node.js version for test image |
NODEJS_LINT_CMD | lint | npm script name for linting |
NODEJS_TEST_CMD | test | npm script name for testing |
Automatically detects the package manager from lockfiles:
pnpm-lock.yaml → pnpmyarn.lock → yarnpackage-lock.json → npmOverride with NODE_PACKAGE_MANAGER variable.
Coverage reports are automatically configured for both Jest and Vitest projects. The cobertura reporter is injected for GitLab MR coverage visualization.