diff --git a/.gitignore b/.gitignore
index 8b50b3991391498385bc30dc8a901fbe416aef38..91a2b40930ac3b166050a988de0778b5f892f55c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,3 +7,6 @@ settings*.cfg
 .cache
 .coverage
 /docs/_build
+.scannerwork
+coverage.xml
+junit.xml
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index ec17fbf1916a62fe29d24212eae5f2ebb1f7af03..b9dfed83de6f8b2999f0159420ee639571cc738e 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -15,6 +15,7 @@ variables:
 stages:
   - build
   - test
+  - analyse
   - release
   - deploy
 
@@ -38,7 +39,20 @@ test:
     - redis:4.0
   before_script: []
   script:
-    - pytest --cov=app -v
+    - pytest --junitxml=junit.xml --cov-report xml:coverage.xml --cov=app -v
+  artifacts:
+    paths:
+      - junit.xml
+      - coverage.xml
+    expire_in: 1 hour
+
+analyse:
+  <<: *runner_tags
+  stage: analyse
+  image: registry.esss.lu.se/ics-docker/sonar-scanner:3
+  before_script: []
+  script:
+    - sonar-scanner -Dsonar.login=$SONARQUBE_TOKEN -Dsonar.projectVersion=$CI_COMMIT_REF_NAME
 
 release-image:
   <<: *runner_tags
diff --git a/sonar-project.properties b/sonar-project.properties
new file mode 100644
index 0000000000000000000000000000000000000000..da42bdf43a99c15afaad418ad949eb44a81e5e77
--- /dev/null
+++ b/sonar-project.properties
@@ -0,0 +1,11 @@
+# must be unique in a given SonarQube instance
+sonar.projectKey=csentry
+# this is the name displayed in the SonarQube UI.
+sonar.projectName=CSEntry
+ 
+# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.
+# This property is optional if sonar.modules is set. 
+sonar.sources=app
+
+sonar.python.xunit.reportPath=junit.xml
+sonar.python.coverage.reportPath=coverage.xml