Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
bee3318d
Commit
bee3318d
authored
Mar 16, 2018
by
Olivier Gonzalez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update Code Quality example documentation
parent
16d92de1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
7 deletions
+15
-7
doc/ci/examples/code_climate.md
doc/ci/examples/code_climate.md
+15
-7
No files found.
doc/ci/examples/code_climate.md
View file @
bee3318d
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment