image: node:latest include: - project: 'general/templates' file: '/cicd/SAST-nodejs.gitlab-ci.yml' - project: 'general/templates' file: '/cicd/npm-audit.gitlab-ci.yml' - project: 'general/templates' file: '/cicd/sonarqube.gitlab-ci.yml' variables: SONAR_PROJECT_KEY: config SONAR_TOKEN: 11922a8e774494f51e1d2f0e695949e4073e7df8 NPM_USERNAME: git NPM_PASSWORD: git NPM_EMAIL: git@git.de NPM_REGISTRY: https://it-devops-01:4873 cache: paths: - node_modules/ - docs/ stages: - build - test - quality - publish build: stage: build script: - npm install --production test: stage: test before_script: - npm install -g jest script: - jest artifacts: paths: - docs/test-report.html - docs/coverage/lcov.info publish to local npm: stage: publish before_script: - npm install -g npm-cli-adduser - npm-cli-adduser --registry $NPM_REGISTRY --username $NPM_USERNAME --password $NPM_PASSWORD --email $NPM_PASSWORD script: - npm publish --registry $NPM_REGISTRY