Commit 81aba67e authored by Olivier Gonzalez's avatar Olivier Gonzalez Committed by Rémy Coutable
Browse files

Use standard codequality job

parent 9c728799
......@@ -618,7 +618,8 @@ karma:
<<: *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: []
......@@ -628,14 +629,15 @@ codequality:
SETUP_DB: "false"
cache: {}
dependencies: []
- 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 (
- docker pull
- docker tag 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 "$SP_VERSION" /code
paths: [codeclimate.json]
expire_in: 1 week
set -eo pipefail
# docker run --tty will merge stderr and stdout, we don't need this on CI or
# it will break codequality json file
[ "$CI" != "" ] || docker_tty="--tty"
# The codebase and instructions for the following image can be found at
docker pull > /dev/null
docker tag codeclimate/codeclimate-rubocop:gitlab-codeclimate-rubocop-0-52-1 > /dev/null
exec docker run --rm $docker_tty --env CODECLIMATE_CODE="$code_path" \
--volume "$code_path":/code \
--volume /var/run/docker.sock:/var/run/docker.sock \
--volume /tmp/cc:/tmp/cc \
"codeclimate/codeclimate:${CODECLIMATE_VERSION:-0.71.1}" "$@"
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment