diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b5d397b66b9eaeb5a7ef1a9b2e35590b19d56e5c..a3e26e6a3f094dd8e813ea61e7fee879a8ebfed7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,84 +1,84 @@ stages: - # - build - # - test - # - sonar + - build + - test + - sonar - docker - deploy -# # ********************************************************************************************* -# # * BUILD BUILD BUILD BUILD BUILD BUILD BUILD BUILD BUILD BUILD BUILD BUILD BUILD BUILD BUILD * -# # * BUILD BUILD BUILD BUILD BUILD BUILD BUILD BUILD BUILD BUILD BUILD BUILD BUILD BUILD BUILD * -# # ********************************************************************************************* +# ********************************************************************************************* +# * BUILD BUILD BUILD BUILD BUILD BUILD BUILD BUILD BUILD BUILD BUILD BUILD BUILD BUILD BUILD * +# * BUILD BUILD BUILD BUILD BUILD BUILD BUILD BUILD BUILD BUILD BUILD BUILD BUILD BUILD BUILD * +# ********************************************************************************************* -# build-back: -# stage: build -# image: ${CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX}/node:16.11.1-alpine -# script: -# - cd back -# - npm i -# - npm run build -# artifacts: -# paths: -# - ./back/node_modules -# expire_in: 1h -# only: -# changes: -# - .gitlab-ci.yml -# - back/**/* +build-back: + stage: build + image: ${CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX}/node:16.11.1-alpine + script: + - cd back + - npm i + - npm run build + artifacts: + paths: + - ./back/node_modules + expire_in: 1h + only: + changes: + - .gitlab-ci.yml + - back/**/* -# # ********************************************************************************************* -# # * TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST * -# # * TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST * -# # ********************************************************************************************* +# ********************************************************************************************* +# * TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST * +# * TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST * +# ********************************************************************************************* -# test-back: -# stage: test -# image: ${CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX}/node:16.11.1-alpine -# script: -# - cd back -# - npm run test:cov -# artifacts: -# paths: -# - ./back/coverage/lcov.info -# expire_in: 5 mins -# only: -# changes: -# - .gitlab-ci.yml -# - back/**/* +test-back: + stage: test + image: ${CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX}/node:16.11.1-alpine + script: + - cd back + - npm run test:cov + artifacts: + paths: + - ./back/coverage/lcov.info + expire_in: 5 mins + only: + changes: + - .gitlab-ci.yml + - back/**/* -# # ********************************************************************************************* -# # * SONAR SONAR SONAR SONAR SONAR SONAR SONAR SONAR SONAR SONAR SONAR SONAR SONAR SONAR SONAR * -# # * SONAR SONAR SONAR SONAR SONAR SONAR SONAR SONAR SONAR SONAR SONAR SONAR SONAR SONAR SONAR * -# # ********************************************************************************************* +# ********************************************************************************************* +# * SONAR SONAR SONAR SONAR SONAR SONAR SONAR SONAR SONAR SONAR SONAR SONAR SONAR SONAR SONAR * +# * SONAR SONAR SONAR SONAR SONAR SONAR SONAR SONAR SONAR SONAR SONAR SONAR SONAR SONAR SONAR * +# ********************************************************************************************* -# sonarqube-back: -# stage: sonar -# rules: -# - if: $CI_PIPELINE_SOURCE == "schedule" -# allow_failure: true -# before_script: -# - apk add --no-cache 'npm>7' -# - cd back -# - npm install --save sonar-scanner -# image: -# name: ${CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX}/sonarsource/sonar-scanner-cli:4 -# entrypoint: [""] -# variables: -# SONAR_URL: http://sonarqube.forge.grandlyon.com:9000 -# GIT_STRATEGY: clone -# GIT_DEPTH: 0 -# script: -# - > -# sonar-scanner -# -Dsonar.projectName=${CI_PROJECT_NAME}-server -# -Dsonar.projectVersion=1.0 -# -Dsonar.sourceEncoding=UTF-8 -# -Dsonar.projectBaseDir=. -# -Dsonar.host.url=${SONAR_URL} -# -Dsonar.projectKey=${SONAR_PROJECT_KEY_SERVER} -# -Dsonar.login=${SONAR_TOKEN_SERVER} -# -Dsonar.sources=src -# -Dsonar.exclusions=**/main.ts,**/*.module.ts,**/*.spec.ts +sonarqube-back: + stage: sonar + rules: + - if: $CI_PIPELINE_SOURCE == "schedule" + allow_failure: true + before_script: + - apk add --no-cache 'npm>7' + - cd back + - npm install --save sonar-scanner + image: + name: ${CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX}/sonarsource/sonar-scanner-cli:4 + entrypoint: [""] + variables: + SONAR_URL: http://sonarqube.forge.grandlyon.com:9000 + GIT_STRATEGY: clone + GIT_DEPTH: 0 + script: + - > + sonar-scanner + -Dsonar.projectName=${CI_PROJECT_NAME}-server + -Dsonar.projectVersion=1.0 + -Dsonar.sourceEncoding=UTF-8 + -Dsonar.projectBaseDir=. + -Dsonar.host.url=${SONAR_URL} + -Dsonar.projectKey=${SONAR_PROJECT_KEY_SERVER} + -Dsonar.login=${SONAR_TOKEN_SERVER} + -Dsonar.sources=src + -Dsonar.exclusions=**/main.ts,**/*.module.ts,**/*.spec.ts # ********************************************************************************************* # * DOCKER DOCKER DOCKER DOCKER DOCKER DOCKER DOCKER DOCKER DOCKER DOCKER DOCKER DOCKER DOCKE *