Skip to content
Snippets Groups Projects
Commit 9a35ee65 authored by Saralegui Vallejo, Unai's avatar Saralegui Vallejo, Unai
Browse files

add sonarqube check for maven

parent f9a69002
No related branches found
No related tags found
No related merge requests found
...@@ -5,6 +5,7 @@ You can include the jobs in this repository's YAML files as follows: ...@@ -5,6 +5,7 @@ You can include the jobs in this repository's YAML files as follows:
```yml ```yml
include: include:
- https://git.code.tecnalia.com/digicon-webxr-store/ci-files/-/raw/master/maven-packages/build.yml - https://git.code.tecnalia.com/digicon-webxr-store/ci-files/-/raw/master/maven-packages/build.yml
- https://git.code.tecnalia.com/digicon-webxr-store/ci-files/-/raw/master/maven-packages/sonarqube.yml
- https://git.code.tecnalia.com/digicon-webxr-store/ci-files/-/raw/master/maven-packages/tests.yml - https://git.code.tecnalia.com/digicon-webxr-store/ci-files/-/raw/master/maven-packages/tests.yml
- https://git.code.tecnalia.com/digicon-webxr-store/ci-files/-/raw/master/maven-packages/deploy.yml - https://git.code.tecnalia.com/digicon-webxr-store/ci-files/-/raw/master/maven-packages/deploy.yml
``` ```
...@@ -14,6 +15,7 @@ You can include the execution order in yout .gitlab-ci.yml file as follows: ...@@ -14,6 +15,7 @@ You can include the execution order in yout .gitlab-ci.yml file as follows:
```yml ```yml
stages: stages:
- build - build
- code_analysis
- test - test
- deploy - deploy
``` ```
...@@ -35,6 +37,7 @@ An example of a valid .gitlab-ci.yml can be: ...@@ -35,6 +37,7 @@ An example of a valid .gitlab-ci.yml can be:
```yml ```yml
include: include:
- https://git.code.tecnalia.com/digicon-webxr-store/ci-files/-/raw/master/maven-packages/build.yml - https://git.code.tecnalia.com/digicon-webxr-store/ci-files/-/raw/master/maven-packages/build.yml
- https://git.code.tecnalia.com/digicon-webxr-store/ci-files/-/raw/master/maven-packages/sonarqube.yml
- https://git.code.tecnalia.com/digicon-webxr-store/ci-files/-/raw/master/maven-packages/tests.yml - https://git.code.tecnalia.com/digicon-webxr-store/ci-files/-/raw/master/maven-packages/tests.yml
- https://git.code.tecnalia.com/digicon-webxr-store/ci-files/-/raw/master/maven-packages/deploy.yml - https://git.code.tecnalia.com/digicon-webxr-store/ci-files/-/raw/master/maven-packages/deploy.yml
...@@ -43,6 +46,7 @@ variables: ...@@ -43,6 +46,7 @@ variables:
stages: stages:
- build - build
- code_analysis
- test - test
- deploy - deploy
......
sonarqube-check:
image: maven:3.6.3-jdk-11
tags:
- docker
stage: code_analysis
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
cache:
key: "${CI_JOB_NAME}"
paths:
- .sonar/cache
script:
- mvn verify sonar:sonar
allow_failure: true
only:
- master # or the name of your main branch
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment