From 87654c0125b37b30e28097c487096899ca6ef8d1 Mon Sep 17 00:00:00 2001 From: Roshan Syed Date: Tue, 1 Oct 2019 14:36:04 -0300 Subject: [PATCH 1/2] Added code_quality to CI --- .gitlab-ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9e3b4e474..f8430f632 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,3 +1,6 @@ +include: + - template: Code-Quality.gitlab-ci.yml + stages: - build - test From 98212ad6915701b1797f23a4642e7ef423c939ee Mon Sep 17 00:00:00 2001 From: Roshan Syed Date: Thu, 3 Oct 2019 16:19:37 -0300 Subject: [PATCH 2/2] Update .gitlab-ci.yml --- .gitlab-ci.yml | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f8430f632..c27f64d05 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,6 +1,3 @@ -include: - - template: Code-Quality.gitlab-ci.yml - stages: - build - test @@ -29,4 +26,26 @@ test: - ./tests/chain_test - ./tests/cli_test tags: - - builder \ No newline at end of file + - builder + +code_quality: + stage: test + image: docker:stable + variables: + DOCKER_DRIVER: overlay2 + allow_failure: true + services: + - docker:stable-dind + script: + - 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 + "registry.gitlab.com/gitlab-org/security-products/codequality:$SP_VERSION" /code + artifacts: + paths: [gl-code-quality-report.json] + expire_in: 1 week + except: + variables: + - $CODE_QUALITY_DISABLED