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:
image: docker:stable
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
include:
template: Jobs/Code-Quality.gitlab-ci.yml

View file

@ -4,21 +4,24 @@ code_quality:
allow_failure: true
services:
- docker:stable-dind
variables:
DOCKER_DRIVER: overlay2
script:
- export CQ_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/')
- |
if ! docker info &>/dev/null; then
if [ -z "$DOCKER_HOST" -a "$KUBERNETES_PORT" ]; then
export DOCKER_HOST='tcp://localhost:2375'
fi
fi
- |
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:$CQ_VERSION" /code
- 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:
paths: [gl-code-quality-report.json]
reports:
codequality: gl-code-quality-report.json
expire_in: 1 week
only:
- branches
- tags