summaryrefslogtreecommitdiff
path: root/.gitlab-ci.yml
diff options
context:
space:
mode:
Diffstat (limited to '.gitlab-ci.yml')
-rw-r--r--.gitlab-ci.yml17
1 files changed, 11 insertions, 6 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 5be942c04ab..86bdb7a4643 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -618,21 +618,26 @@ karma:
codequality:
<<: *dedicated-no-docs-no-db-pull-cache-job
- image: docker:latest
+ image: docker:stable
+ allow_failure: true
+ # gitlab-org runners set `privileged: false` but we need to have it set to true
+ # since we're using Docker in Docker
+ tags: []
before_script: []
services:
- docker:dind
variables:
SETUP_DB: "false"
DOCKER_DRIVER: overlay2
- CODECLIMATE_FORMAT: json
cache: {}
dependencies: []
script:
- - apk update && apk add jq
- - ./scripts/codequality analyze -f json > raw_codeclimate.json || true
- # The following line keeps only the fields used in the MR widget, reducing the JSON artifact size
- - jq -c 'map({check_name,description,fingerprint,location})' raw_codeclimate.json > codeclimate.json
+ # Get the custom rubocop codeclimate image (https://gitlab.com/gitlab-org/codeclimate-rubocop/wikis/home)
+ - docker pull dev.gitlab.org:5005/gitlab/gitlab-build-images:gitlab-codeclimate-rubocop-0-52-1
+ - docker tag dev.gitlab.org:5005/gitlab/gitlab-build-images:gitlab-codeclimate-rubocop-0-52-1 codeclimate/codeclimate-rubocop:gitlab-codeclimate-rubocop-0-52-1
+ # Extract "MAJOR.MINOR" from CI_SERVER_VERSION and generate "MAJOR-MINOR-stable" for Security Products
+ - 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:
paths: [codeclimate.json]
expire_in: 1 week