-`.default-tags`: Ensures a job has the `gitlab-org` tag to ensure it's using
| `.default-tags` | Ensures a job has the `gitlab-org` tag to ensure it's using our dedicated runners. |
our dedicated runners.
| `.default-retry` | Allows a job to [retry](../ci/yaml/README.md#retry) upon `unknown_failure`, `api_failure`, `runner_system_failure`, `job_execution_timeout`, or `stuck_or_timeout_failure`. |
-`.default-retry`: Allows a job to [retry](../ci/yaml/README.md#retry) upon `unknown_failure`, `api_failure`,
| `.default-before_script` | Allows a job to use a default `before_script` definition suitable for Ruby/Rails tasks that may need a database running (e.g. tests). |
`runner_system_failure`, `job_execution_timeout`, or `stuck_or_timeout_failure`.
| `.default-cache` | Allows a job to use a default `cache` definition suitable for Ruby/Rails and frontend tasks. |
-`.default-before_script`: Allows a job to use a default `before_script` definition
| `.use-pg9` | Allows a job to use the `postgres:9.6.17` and `redis:alpine` services. |
suitable for Ruby/Rails tasks that may need a database running (e.g. tests).
| `.use-pg10` | Allows a job to use the `postgres:10.12` and `redis:alpine` services. |
-`.default-cache`: Allows a job to use a default `cache` definition suitable for
| `.use-pg9-ee` | Same as `.use-pg9` but also use the `docker.elastic.co/elasticsearch/elasticsearch:6.4.2` services. |
Ruby/Rails and frontend tasks.
| `.use-pg10-ee` | Same as `.use-pg10` but also use the `docker.elastic.co/elasticsearch/elasticsearch:6.4.2` services. |
-`.default-only`: Restricts the cases where a job is created. This currently
| `.as-if-foss` | Simulate the FOSS project by setting the `FOSS_ONLY='1'` environment variable. |
includes `master`, `/^[\d-]+-stable(-ee)?$/` (stable branches),
and included in `rules` definitions via [YAML anchors](../ci/yaml/README.md#anchors)
-`.only:kubernetes`: Only creates a job if a Kubernetes integration is enabled
on the project.
### `if:` conditions
-`.only-review`: This extends from:
-`.only:variables-canonical-dot-com`
| `if:` conditions | Description | Notes |
-`.only:kubernetes`
|------------------|-------------|-------|
-`.except:refs-master-tags-stable-deploy`
| `if-not-canonical-namespace` | Matches if the project isn't in the canonical (`gitlab-org/`) or security (`gitlab-org/security`) namespace. | Use to create a job for forks (by using `when: on_success\|manual`), or **not** create a job for forks (by using `when: never`). |
-`.only-review-schedules`: This extends from:
| `if-not-ee` | Matches if the project isn't EE (i.e. project name isn't `gitlab` or `gitlab-ee`). | Use to create a job only in the FOSS project (by using `when: on_success|manual`), or **not** create a job if the project is EE (by using `when: never`). |
| `if-not-foss` | Matches if the project isn't FOSS (i.e. project name isn't `gitlab-foss`, `gitlab-ce`, or `gitlabhq`). | Use to create a job only in the EE project (by using `when: on_success|manual`), or **not** create a job if the project is FOSS (by using `when: never`). |
-`.only:kubernetes`
| `if-default-refs` | Matches if the pipeline is for `master`, `/^[\d-]+-stable(-ee)?$/` (stable branches), `/^\d+-\d+-auto-deploy-\d+$/` (auto-deploy branches), `/^security\//` (security branches), merge requests, and tags. | Note that jobs won't be created for branches with this default configuration. |
-`.except:refs-deploy`
| `if-master-refs` | Matches if the current branch is `master`. | |
-`.use-pg9`: Allows a job to use the `postgres:9.6` and `redis:alpine` services.
| `if-master-or-tag` | Matches if the pipeline is for the `master` branch or for a tag. | |
-`.use-pg10`: Allows a job to use the `postgres:10.9` and `redis:alpine` services.
| `if-merge-request` | Matches if the pipeline is for a merge request. | |
-`.use-pg9-ee`: Same as `.use-pg9` but also use the
| `if-dot-com-gitlab-org-schedule` | Limits jobs creation to scheduled pipelines for the `gitlab-org` group on GitLab.com. | |
| `if-dot-com-gitlab-org-and-security-tag` | Limits job creation to tags for the `gitlab-org` and `gitlab-org/security` groups on GitLab.com. | |
-`.only-ee`: Only creates a job for the `gitlab` or `gitlab-ee` project.
| `if-dot-com-gitlab-org-and-security-merge-request` | Limit jobs creation to merge requests for the `gitlab-org` and `gitlab-org/security` groups on GitLab.com. | |
-`.only-ee-as-if-foss`: Same as `.only-ee` but simulate the FOSS project by
| `if-dot-com-ee-schedule` | Limits jobs to scheduled pipelines for the `gitlab-org/gitlab` project on GitLab.com. | |
setting the `FOSS_ONLY='1'` environment variable.
| `if-cache-credentials-schedule` | Limits jobs to scheduled pipelines with the `$CI_REPO_CACHE_CREDENTIALS` variable set. | |
## Changes detection
### `changes:` patterns
If a job extends from `.default-only` (and most of the jobs should), it can restrict
[based on the changes](../ci/yaml/README.md#onlychangesexceptchanges)
| `yaml-patterns` | Only create job for YAML-related changes. |
from a commit or MR by extending from the following CI definitions:
| `docs-patterns` | Only create job for docs-related changes. |
| `backstage-patterns` | Only create job for backstage-related changes. |
-`.only:changes-code`: Allows a job to only be created upon code-related changes.
| `code-patterns` | Only create job for code-related changes. |
-`.only:changes-qa`: Allows a job to only be created upon QA-related changes.
| `qa-patterns` | Only create job for QA-related changes. |
-`.only:changes-docs`: Allows a job to only be created upon docs-related changes.
| `code-backstage-patterns` | Combination of `code-patterns` and `backstage-patterns`. |
-`.only:changes-graphql`: Allows a job to only be created upon GraphQL-related changes.
| `code-qa-patterns` | Combination of `code-patterns` and `qa-patterns`. |
-`.only:changes-code-backstage`: Allows a job to only be created upon code-related or backstage-related (e.g. Danger, RuboCop, specs) changes.
| `code-backstage-qa-patterns` | Combination of `code-patterns`, `backstage-patterns`, and `qa-patterns`. |
-`.only:changes-code-qa`: Allows a job to only be created upon code-related or QA-related changes.
-`.only:changes-code-backstage-qa`: Allows a job to only be created upon code-related, backstage-related (e.g. Danger, RuboCop, specs) or QA-related changes.