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
d38ae432
Commit
d38ae432
authored
Nov 12, 2021
by
Evan Read
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Restructure `rules` with `include` documentation and add example
parent
8d2696c7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
15 deletions
+33
-15
doc/ci/yaml/includes.md
doc/ci/yaml/includes.md
+33
-15
No files found.
doc/ci/yaml/includes.md
View file @
d38ae432
...
...
@@ -272,22 +272,40 @@ see this [CI/CD variable demo](https://youtu.be/4XR8gw3Pkos).
> - [Support for `exists` keyword added](https://gitlab.com/gitlab-org/gitlab/-/issues/341511) in GitLab 14.5.
You can use
[
`rules`
](
index.md#rules
)
with
`include`
to conditionally include other configuration files.
You can only use
[
`if` rules
](
index.md#rulesif
)
and
[
`exists` rules
](
index.md#rulesexists
)
in
`include`
, and only with
[
certain variables
](
#use-variables-with-include
)
.
`rules`
keyword
`changes`
is not supported.
```
yaml
include
:
-
local
:
builds.yml
rules
:
-
if
:
'
$INCLUDE_BUILDS
==
"true"'
-
local
:
deploys.yml
rules
:
-
if
:
$CI_COMMIT_BRANCH == "main"
test
:
stage
:
test
script
:
exit 0
```
You can only use the following rules with
`include`
(and only with
[
certain variables
](
#use-variables-with-include
)
):
-
[
`if` rules
](
index.md#rulesif
)
. For example:
```
yaml
include
:
-
local
:
builds.yml
rules
:
-
if
:
'
$INCLUDE_BUILDS
==
"true"'
-
local
:
deploys.yml
rules
:
-
if
:
$CI_COMMIT_BRANCH == "main"
test
:
stage
:
test
script
:
exit 0
```
-
[
`exists` rules
](
index.md#rulesexists
)
. For example:
```
yaml
include
:
-
local
:
builds.yml
rules
:
-
exists
:
-
file.md
test
:
stage
:
test
script
:
exit 0
```
`rules`
keyword
`changes`
is not supported.
## Use `include:local` with wildcard file paths
...
...
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