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