Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'doc/ci/testing/code_quality.md')
-rw-r--r--doc/ci/testing/code_quality.md48
1 files changed, 43 insertions, 5 deletions
diff --git a/doc/ci/testing/code_quality.md b/doc/ci/testing/code_quality.md
index 401279b9601..7345c7ca5eb 100644
--- a/doc/ci/testing/code_quality.md
+++ b/doc/ci/testing/code_quality.md
@@ -1,7 +1,7 @@
---
stage: Secure
group: Static Analysis
-info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
+info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
---
# Code Quality **(FREE)**
@@ -313,7 +313,7 @@ the nested architecture of container execution, the registry prefix must
be specifically configured to be passed down into CodeClimate's subsequent
`docker pull` commands for individual engines.
-The following two variables can address all of the required image pulls:
+The following variables can address all of the required image pulls:
- `CODE_QUALITY_IMAGE`: A fully prefixed image name that can be located anywhere
accessible from your job environment. GitLab Container Registry can be used here
@@ -322,6 +322,8 @@ The following two variables can address all of the required image pulls:
is a configuration option supported by [CodeClimate CLI](https://github.com/codeclimate/codeclimate/pull/948). You must:
- Include a trailing slash (`/`).
- Not include a protocol prefix, such as `https://`.
+- `CODECLIMATE_REGISTRY_USERNAME`: An optional variable to specify the username for the registry domain parsed from `CODECLIMATE_PREFIX`.
+- `CODECLIMATE_REGISTRY_PASSWORD`: An optional variable to specify the password for the registry domain parsed from `CODECLIMATE_PREFIX`.
```yaml
include:
@@ -333,13 +335,49 @@ code_quality:
CODECLIMATE_PREFIX: "my-private-registry.local:12345/"
```
-The images in the private container image registry must be available without authentication.
-Follow [this issue](https://gitlab.com/gitlab-org/gitlab/-/issues/355814) for more information.
-
This example is specific to GitLab Code Quality. For more general
instructions on how to configure DinD with a registry mirror, see the
relevant [documentation](../docker/using_docker_build.md#enable-registry-mirror-for-dockerdind-service).
+#### Configure Code Quality to use the Dependency Proxy
+
+Prerequisite:
+
+- The project must be in a group where the [Dependency Proxy](../../user/packages/dependency_proxy/index.md) is enabled.
+
+Here is an example of how to configure Code Quality to use the Dependency Proxy:
+
+```yaml
+include:
+ - template: Jobs/Code-Quality.gitlab-ci.yml
+
+code_quality:
+ variables:
+ CODE_QUALITY_IMAGE: "$CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX/codequality:0.85.24"
+ ## You must add a trailing slash to `$CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX`.
+ CODECLIMATE_PREFIX: $CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX/
+ CODECLIMATE_REGISTRY_USERNAME: $CI_DEPENDENCY_PROXY_USER
+ CODECLIMATE_REGISTRY_PASSWORD: $CI_DEPENDENCY_PROXY_PASSWORD
+```
+
+#### Configure Code Quality to use Dockerhub with authentication
+
+Here is an example of how to configure Code Quality to use Dockerhub with authentication:
+
+```yaml
+include:
+ - template: Jobs/Code-Quality.gitlab-ci.yml
+
+code_quality:
+ variables:
+ CODECLIMATE_PREFIX: "registry-1.docker.io/"
+ CODECLIMATE_REGISTRY_USERNAME: $DOCKERHUB_USERNAME
+ CODECLIMATE_REGISTRY_PASSWORD: $DOCKERHUB_PASSWORD
+```
+
+You should add the username and password as [protected CI/CD variables](../variables/index.md#add-a-cicd-variable-to-a-project)
+in the project.
+
## Configuring jobs using variables
The Code Quality job supports environment variables that users can set to