Commit dd639aad authored by Olivier Gonzalez's avatar Olivier Gonzalez

Rename code quality job and artifact. Refs gitlab-org/gitlab-ee#5779

parent 6c51e220
...@@ -690,7 +690,7 @@ karma: ...@@ -690,7 +690,7 @@ karma:
- chrome_debug.log - chrome_debug.log
- coverage-javascript/ - coverage-javascript/
codequality: code_quality:
<<: *dedicated-no-docs-no-db-pull-cache-job <<: *dedicated-no-docs-no-db-pull-cache-job
image: docker:stable image: docker:stable
allow_failure: true allow_failure: true
...@@ -710,7 +710,7 @@ codequality: ...@@ -710,7 +710,7 @@ codequality:
- export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/') - 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 - 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: artifacts:
paths: [codeclimate.json] paths: [gl-code-quality-report.json]
expire_in: 1 week expire_in: 1 week
sast: sast:
......
...@@ -5,10 +5,10 @@ GitLab CI and Docker. ...@@ -5,10 +5,10 @@ GitLab CI and Docker.
First, you need GitLab Runner with [docker-in-docker executor][dind]. First, you need GitLab Runner with [docker-in-docker executor][dind].
Once you set up the Runner, add a new job to `.gitlab-ci.yml`, called `codequality`: Once you set up the Runner, add a new job to `.gitlab-ci.yml`, called `code_quality`:
```yaml ```yaml
codequality: code_quality:
image: docker:stable image: docker:stable
variables: variables:
DOCKER_DRIVER: overlay2 DOCKER_DRIVER: overlay2
...@@ -23,18 +23,18 @@ codequality: ...@@ -23,18 +23,18 @@ codequality:
--volume /var/run/docker.sock:/var/run/docker.sock --volume /var/run/docker.sock:/var/run/docker.sock
"registry.gitlab.com/gitlab-org/security-products/codequality:$SP_VERSION" /code "registry.gitlab.com/gitlab-org/security-products/codequality:$SP_VERSION" /code
artifacts: artifacts:
paths: [codeclimate.json] paths: [gl-code-quality-report.json]
``` ```
The above example will create a `codequality` job in your CI/CD pipeline which The above example will create a `code_quality` job in your CI/CD pipeline which
will scan your source code for code quality issues. The report will be saved will scan your source code for code quality issues. The report will be saved
as an artifact that you can later download and analyze. as an artifact that you can later download and analyze.
TIP: **Tip:** TIP: **Tip:**
Starting with [GitLab Starter][ee] 9.3, this information will Starting with [GitLab Starter][ee] 9.3, this information will
be automatically extracted and shown right in the merge request widget. To do 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 so, the CI/CD job must be named `code_quality` and the artifact path must be
`codeclimate.json`. `gl-code-quality-report.json`.
[Learn more on code quality diffs in merge requests](https://docs.gitlab.com/ee/user/project/merge_requests/code_quality_diff.html). [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 [cli]: https://github.com/codeclimate/codeclimate
......
...@@ -220,8 +220,8 @@ tests, it's up to you to add them. ...@@ -220,8 +220,8 @@ tests, it's up to you to add them.
### Auto Code Quality ### Auto Code Quality
Auto Code Quality uses the open source Auto Code Quality uses the
[`codeclimate` image](https://hub.docker.com/r/codeclimate/codeclimate/) to run [Code Quality image](https://gitlab.com/gitlab-org/security-products/codequality) to run
static analysis and other code checks on the current code. The report is static analysis and other code checks on the current code. The report is
created, and is uploaded as an artifact which you can later download and check created, and is uploaded as an artifact which you can later download and check
out. out.
......
...@@ -126,10 +126,10 @@ Next, a pipeline needs to be triggered. Since the test project doesn't have a ...@@ -126,10 +126,10 @@ Next, a pipeline needs to be triggered. Since the test project doesn't have a
manually visit `https://gitlab.com/<username>/minimal-ruby-app/pipelines/new`, manually visit `https://gitlab.com/<username>/minimal-ruby-app/pipelines/new`,
where `<username>` is your username. where `<username>` is your username.
This will create a new pipeline with several jobs: `build`, `test`, `codequality`, This will create a new pipeline with several jobs: `build`, `test`, `code_quality`,
and `production`. The `build` job will create a Docker image with your new and `production`. The `build` job will create a Docker image with your new
change and push it to the Container Registry. The `test` job will test your change and push it to the Container Registry. The `test` job will test your
changes, whereas the `codequality` job will run static analysis on your changes. changes, whereas the `code_quality` job will run static analysis on your changes.
Finally, the `production` job will deploy your changes to a production application. Finally, the `production` job will deploy your changes to a production application.
Once the deploy job succeeds you should be able to see your application by Once the deploy job succeeds you should be able to see your application by
......
...@@ -217,7 +217,7 @@ export const pipelineWithStages = { ...@@ -217,7 +217,7 @@ export const pipelineWithStages = {
browse_path: '/gitlab-org/gitlab-ee/-/jobs/62411442/artifacts/browse', browse_path: '/gitlab-org/gitlab-ee/-/jobs/62411442/artifacts/browse',
}, },
{ {
name: 'codequality', name: 'code_quality',
expired: false, expired: false,
expire_at: '2018-04-18T14:16:24.484Z', expire_at: '2018-04-18T14:16:24.484Z',
path: '/gitlab-org/gitlab-ee/-/jobs/62411441/artifacts/download', path: '/gitlab-org/gitlab-ee/-/jobs/62411441/artifacts/download',
......
...@@ -77,7 +77,7 @@ test: ...@@ -77,7 +77,7 @@ test:
only: only:
- branches - branches
codequality: code_quality:
image: docker:stable image: docker:stable
variables: variables:
DOCKER_DRIVER: overlay2 DOCKER_DRIVER: overlay2
...@@ -86,9 +86,9 @@ codequality: ...@@ -86,9 +86,9 @@ codequality:
- docker:stable-dind - docker:stable-dind
script: script:
- setup_docker - setup_docker
- codeclimate - code_quality
artifacts: artifacts:
paths: [codeclimate.json] paths: [gl-code-quality-report.json]
performance: performance:
stage: performance stage: performance
...@@ -409,7 +409,7 @@ rollout 100%: ...@@ -409,7 +409,7 @@ rollout 100%:
./clair-scanner -c http://docker:6060 --ip $(hostname -i) -r gl-sast-container-report.json -l clair.log -w clair-whitelist.yml ${CI_APPLICATION_REPOSITORY}:${CI_APPLICATION_TAG} || true ./clair-scanner -c http://docker:6060 --ip $(hostname -i) -r gl-sast-container-report.json -l clair.log -w clair-whitelist.yml ${CI_APPLICATION_REPOSITORY}:${CI_APPLICATION_TAG} || true
} }
function codeclimate() { function code_quality() {
docker run --env SOURCE_CODE="$PWD" \ docker run --env SOURCE_CODE="$PWD" \
--volume "$PWD":/code \ --volume "$PWD":/code \
--volume /var/run/docker.sock:/var/run/docker.sock \ --volume /var/run/docker.sock:/var/run/docker.sock \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment