debian-mirror-gitlab/lib/gitlab/ci/templates/Jobs/Code-Quality.gitlab-ci.yml
2020-03-13 15:44:24 +05:30

37 lines
1.1 KiB
YAML

code_quality:
stage: test
# pin to a version matching the dind service, just to be safe
image: docker:19.03.5
allow_failure: true
services:
# pin to a known working version until https://gitlab.com/gitlab-org/gitlab-runner/issues/6697 is fixed
- docker:19.03.5-dind
variables:
DOCKER_DRIVER: overlay2
DOCKER_TLS_CERTDIR: ""
CODE_QUALITY_IMAGE: "registry.gitlab.com/gitlab-org/security-products/codequality:0.85.6"
script:
- |
if ! docker info &>/dev/null; then
if [ -z "$DOCKER_HOST" -a "$KUBERNETES_PORT" ]; then
export DOCKER_HOST='tcp://localhost:2375'
fi
fi
- docker pull --quiet "$CODE_QUALITY_IMAGE"
- docker run
--env SOURCE_CODE="$PWD"
--volume "$PWD":/code
--volume /var/run/docker.sock:/var/run/docker.sock
"$CODE_QUALITY_IMAGE" /code
artifacts:
reports:
codequality: gl-code-quality-report.json
expire_in: 1 week
dependencies: []
only:
refs:
- branches
- tags
except:
variables:
- $CODE_QUALITY_DISABLED