Refactor Code Quality templates into single file

This commit is contained in:
Matija Čupić 2019-06-14 14:05:49 +02:00
parent c7c960cca6
commit f0773d9ec8
No known key found for this signature in database
GPG Key ID: 4BAF84FFACD2E5DE
2 changed files with 12 additions and 24 deletions

View File

@ -1,17 +1,2 @@
code_quality: include:
image: docker:stable template: Jobs/Code-Quality.gitlab-ci.yml
allow_failure: true
services:
- docker:stable-dind
variables:
DOCKER_DRIVER: overlay2
script:
- 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:11-8-stable" /code
artifacts:
reports:
codequality: gl-code-quality-report.json
expire_in: 1 week

View File

@ -4,21 +4,24 @@ code_quality:
allow_failure: true allow_failure: true
services: services:
- docker:stable-dind - docker:stable-dind
variables:
DOCKER_DRIVER: overlay2
script: script:
- export CQ_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/')
- | - |
if ! docker info &>/dev/null; then if ! docker info &>/dev/null; then
if [ -z "$DOCKER_HOST" -a "$KUBERNETES_PORT" ]; then if [ -z "$DOCKER_HOST" -a "$KUBERNETES_PORT" ]; then
export DOCKER_HOST='tcp://localhost:2375' export DOCKER_HOST='tcp://localhost:2375'
fi fi
fi fi
- | - docker run
docker run --env SOURCE_CODE="$PWD" \ --env SOURCE_CODE="$PWD"
--volume "$PWD":/code \ --volume "$PWD":/code
--volume /var/run/docker.sock:/var/run/docker.sock \ --volume /var/run/docker.sock:/var/run/docker.sock
"registry.gitlab.com/gitlab-org/security-products/codequality:$CQ_VERSION" /code "registry.gitlab.com/gitlab-org/security-products/codequality:11-8-stable" /code
artifacts: artifacts:
paths: [gl-code-quality-report.json] reports:
codequality: gl-code-quality-report.json
expire_in: 1 week
only: only:
- branches - branches
- tags - tags