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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
bcc737bb
Commit
bcc737bb
authored
Apr 19, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
255071ac
ace5c789
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
21 deletions
+27
-21
.gitlab/ci/reports.gitlab-ci.yml
.gitlab/ci/reports.gitlab-ci.yml
+1
-1
doc/ci/examples/code_quality.md
doc/ci/examples/code_quality.md
+26
-20
No files found.
.gitlab/ci/reports.gitlab-ci.yml
View file @
bcc737bb
include
:
-
local
:
/lib/gitlab/ci/templates/
Code-Quality.gitlab-ci.yml
-
template
:
Code-Quality.gitlab-ci.yml
code_quality
:
extends
:
.dedicated-no-docs-no-db-pull-cache-job
...
...
doc/ci/examples/code_quality.md
View file @
bcc737bb
# Analyze your project's Code Quality
CAUTION:
**Caution:**
The job definition shown below is supported on GitLab 11.
5
and later versions.
The job definition shown below is supported on GitLab 11.
11
and later versions.
It also requires the GitLab Runner 11.5 or later.
For earlier versions, use the
[
previous job definitions
](
#previous-job-definitions
)
.
...
...
@@ -11,27 +11,11 @@ and Docker.
First, you need GitLab Runner with
[
docker-in-docker executor
](
../docker/using_docker_build.md#use-docker-in-docker-executor
)
.
Once you set up the Runner, add a new job to
`.gitlab-ci.yml`
that
generates the expected report:
Once you set up the Runner, include the CodeQuality template in your CI config:
```
yaml
code_quality
:
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
:
reports
:
codequality
:
gl-code-quality-report.json
include
:
-
template
:
Code-Quality.gitlab-ci.yml
```
The above example will create a
`code_quality`
job in your CI/CD pipeline which
...
...
@@ -54,6 +38,28 @@ While these old job definitions are still maintained they have been deprecated
and may be removed in next major release, GitLab 12.0.
You are advised to update your current
`.gitlab-ci.yml`
configuration to reflect that change.
For GitLab 11.5 and earlier, the job should look like:
```
yaml
code_quality
:
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
:
reports
:
codequality
:
gl-code-quality-report.json
```
For GitLab 11.4 and earlier, the job should look like:
```
yaml
...
...
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