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
path: root/doc/ci/yaml
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-08-12 06:10:11 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-08-12 06:10:11 +0300
commite6de69cc2eae87536ed97df4dee36980583010f5 (patch)
tree453e41dd20186d8b7a0ccd6e1161a54d496deae3 /doc/ci/yaml
parentd9e285a74bf01b1a61108a8091a88579361ef189 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'doc/ci/yaml')
-rw-r--r--doc/ci/yaml/index.md26
1 files changed, 26 insertions, 0 deletions
diff --git a/doc/ci/yaml/index.md b/doc/ci/yaml/index.md
index 901fdc38234..90c059e646d 100644
--- a/doc/ci/yaml/index.md
+++ b/doc/ci/yaml/index.md
@@ -436,6 +436,32 @@ include:
For an example of how you can include these predefined variables, and the variables' impact on CI/CD jobs,
see this [CI/CD variable demo](https://youtu.be/4XR8gw3Pkos).
+There is a [related issue](https://gitlab.com/gitlab-org/gitlab/-/issues/337633)
+that proposes expanding this feature to support more variables.
+
+#### `rules` with `include`
+
+> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/276515) in GitLab 14.2.
+
+NOTE:
+On self-managed GitLab, by default this feature is not available. To make it available,
+ask an administrator to [enable the `ci_include_rules` flag](../../administration/feature_flags.md).
+On GitLab.com, this feature is not available. The feature is not ready for production use.
+
+You can use [`rules`](#rules) with `include` to conditionally include other configuration files.
+You can only use `rules:if` in `include` with [certain variables](#variables-with-include).
+
+```yaml
+include:
+ - local: builds.yml
+ rules:
+ - if: '$INCLUDE_BUILDS == "true"'
+
+test:
+ stage: test
+ script: exit 0
+```
+
#### `include:local`
Use `include:local` to include a file that is in the same repository as the `.gitlab-ci.yml` file.