diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000000000000000000000000000000000000..675f2ee3d0c46608ea58ad18206b38eeddd11f77 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,33 @@ +stages: + - build + - quality + +variables: + SONAR_USER_HOME: "${CI_PROJECT_DIR}/.sonar" # Defines the location of the analysis task cache + GIT_DEPTH: "0" # Tells git to fetch all the branches of the project, required by the analysis task + +default: + image: node:lts-slim + +build_job: + stage: build + script: + - npm ci # A la place de npm install + - npm run build + artifacts: + expire_in: + - 1 hour + paths: + - dist/ + +quality_job: + image: leadrien/isc-sonar-scanner-cli:latest + stage: quality + script: + - sonar-scanner -Dsonar.host.url="${SONAR_HOST_URL}" + cache: + policy: pull-push + key: "sonar-cache-$CI_COMMIT_REF_SLUG" + paths: + - "${SONAR_USER_HOME}/cache" + - sonar-scanner/ diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 0000000000000000000000000000000000000000..6ec939f6018addff11c36d6a3ac522e70eda17fc --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,2 @@ +sonar.projectKey=davila-lou-breakout +sonar.qualitygate.wait=true \ No newline at end of file