Test Gitlab CodeQuality integration
authorThierry Florac <tflorac@ulthar.net>
Wed, 20 Nov 2019 18:28:10 +0100
changeset 404 3f249488b3ff
parent 403 f5bfec044a1a
child 405 063ccbe396de
child 410 0b9e3e67f43d
child 423 d69d9c919448
Test Gitlab CodeQuality integration
.gitlab-ci.yml
--- a/.gitlab-ci.yml	Mon Oct 07 14:01:17 2019 +0200
+++ b/.gitlab-ci.yml	Wed Nov 20 18:28:10 2019 +0100
@@ -26,18 +26,19 @@
 
 quality:
     stage: test
-    image: docker:latest
+    image: docker:stable
     variables:
-        DOCKER_DRIVER: overlay
+        DOCKER_DRIVER: overlay2
     allow_failure: true
     services:
-        - docker:dind
+        - docker:stable-dind
     script:
-        - docker pull codeclimate/codeclimate
-        - VOLUME_PATH=/tmp/builds"$(echo $PWD | sed 's|^/[^/]*||')"
-        - docker run -v /tmp/cc:/tmp/cc -v $VOLUME_PATH:/code -v /var/run/docker.sock:/var/run/docker.sock codeclimate/codeclimate validate-config
-        - echo $PWD
-        - docker run --env CODECLIMATE_CODE="$VOLUME_PATH" -v /tmp/cc:/tmp/cc -v $VOLUME_PATH:/code -v /var/run/docker.sock:/var/run/docker.sock codeclimate/codeclimate analyze -f json >codeclimate.json
+        - export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/')
+        - docker run
+            --env SOURCE_CODE="$PWD"
+            --volume "$PWD":/code
+            --volume /var/run/docker.sock:/var/run/docker.sock
+            "registry.gitlab.com/gitlab-org/security-products/codequality:$SP_VERSION" /code
     artifacts:
         reports:
-            codequality: codeclimate.json
+            codequality: gl-code-quality-report.json