diff options
author | Achilleas Pipinellis <axil@gitlab.com> | 2018-03-16 14:52:38 +0000 |
---|---|---|
committer | Achilleas Pipinellis <axil@gitlab.com> | 2018-03-16 14:52:38 +0000 |
commit | f1542a90c29e4f84baf68babe78f3377b32d2c06 (patch) | |
tree | 6a43bdf7a10acabc302c445ccdbc1b6a9531060a /doc/ci/examples | |
parent | e332f3f9b407aa726f4e8b32d501af32adfa9848 (diff) | |
parent | bee3318d187ec2c798684880ba2b705e75a157e9 (diff) | |
download | gitlab-ce-f1542a90c29e4f84baf68babe78f3377b32d2c06.tar.gz |
Merge branch 'docs-update_code_quality_example' into 'master'
Update Code Quality example documentation
See merge request gitlab-org/gitlab-ce!17788
Diffstat (limited to 'doc/ci/examples')
-rw-r--r-- | doc/ci/examples/code_climate.md | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/doc/ci/examples/code_climate.md b/doc/ci/examples/code_climate.md index d7df53494ed..ec5e5afb8c6 100644 --- a/doc/ci/examples/code_climate.md +++ b/doc/ci/examples/code_climate.md @@ -16,18 +16,26 @@ codequality: - docker:dind script: - docker pull codeclimate/codeclimate - - docker run --env CODECLIMATE_CODE="$PWD" --volume "$PWD":/code --volume /var/run/docker.sock:/var/run/docker.sock --volume /tmp/cc:/tmp/cc codeclimate/codeclimate:0.69.0 init - - docker run --env CODECLIMATE_CODE="$PWD" --volume "$PWD":/code --volume /var/run/docker.sock:/var/run/docker.sock --volume /tmp/cc:/tmp/cc codeclimate/codeclimate:0.69.0 analyze -f json > codeclimate.json || true + - 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: [codeclimate.json] ``` -This will create a `codequality` job in your CI pipeline and will allow you to -download and analyze the report artifact in JSON format. +The above example will create a `codequality` job in your CI/CD pipeline which +will scan your source code for code quality issues. The report will be saved +as an artifact that you can later download and analyze. -For [GitLab Starter][ee] users, this information can be automatically -extracted and shown right in the merge request widget. [Learn more on code quality -diffs in merge requests](https://docs.gitlab.com/ee/user/project/merge_requests/code_quality_diff.html). +TIP: **Tip:** +Starting with [GitLab Starter][ee] 9.3, this information will +be automatically extracted and shown right in the merge request widget. To do +so, the CI/CD job must be named `codequality` and the artifact path must be +`codeclimate.json`. +[Learn more on code quality diffs in merge requests](https://docs.gitlab.com/ee/user/project/merge_requests/code_quality_diff.html). [cli]: https://github.com/codeclimate/codeclimate [dind]: ../docker/using_docker_build.md#use-docker-in-docker-executor |