Newer
Older
- sonar
- build
- dockerize
variables:
VERSION: "3.7.0"
SONARQUBE_URL: https://sonarqube.lam.fr
install_dependencies:
image: node:16-slim
stage: install_dependencies
cache:
test:
image: node:16-slim
stage: test
cache:
key: ${CI_COMMIT_REF_SLUG}_client
paths:
- node_modules
policy: pull
script:
- npx jest --coverage --coverageReporters lcov
artifacts:
paths:
- client/coverage
sonar_scanner:
image: sonarsource/sonar-scanner-cli:latest
stage: sonar
cache:
-Dsonar.sources=src
-Dsonar.projectVersion=$VERSION
-Dsonar.host.url=$SONARQUBE_URL
-Dsonar.login=$SONAR_TOKEN_CLIENT
-Dsonar.exclusions=**.spec.ts
-Dsonar.typescript.lcov.reportPaths=./coverage/anis-client/lcov.info
build:
image: node:16-slim
stage: build
cache:
- yarn global add @angular/cli@latest
- ng build
artifacts:
paths:
dockerize:
image: docker:stable
stage: dockerize
cache: {}
script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker pull $CI_REGISTRY/anis/anis-next/client:latest || true
- docker build --cache-from $CI_REGISTRY/anis/anis-next/client:latest -t $CI_REGISTRY/anis/anis-next/client:latest .
- docker push $CI_REGISTRY/anis/anis-next/client:latest