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
ed44cb55
Commit
ed44cb55
authored
Jul 08, 2020
by
Ben Bodenmiller
Committed by
Marcel Amirault
Jul 08, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Better organize how to use workflow:rules
parent
37d86926
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
18 deletions
+20
-18
doc/ci/yaml/README.md
doc/ci/yaml/README.md
+20
-18
No files found.
doc/ci/yaml/README.md
View file @
ed44cb55
...
...
@@ -298,6 +298,26 @@ determine whether or not a pipeline is created. It currently accepts a single
`rules:`
key that operates similarly to
[
`rules:` defined within jobs
](
#rules
)
,
enabling dynamic configuration of the pipeline.
If you are new to GitLab CI/CD and
`workflow: rules`
, you may find the
[
`workflow:rules` templates
](
#workflowrules-templates
)
useful.
To define your own
`workflow: rules`
, the configuration options currently available are:
-
[
`if`
](
#rulesif
)
: Define a rule.
-
[
`when`
](
#when
)
: May be set to
`always`
or
`never`
only. If not provided, the default value is
`always`
.
The list of
`if`
rules is evaluated until a single one is matched. If none
match, the last
`when`
will be used:
```
yaml
workflow
:
rules
:
-
if
:
$CI_COMMIT_REF_NAME =~ /-wip$/
when
:
never
-
if
:
$CI_COMMIT_TAG
when
:
never
-
when
:
always
```
#### `workflow:rules` templates
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/217732) in GitLab 13.0.
...
...
@@ -335,24 +355,6 @@ include:
-
template
:
'
Workflows/MergeRequest-Pipelines.gitlab-ci.yml'
```
If you prefer to define your own rules, the configuration options currently available are:
-
[
`if`
](
#rulesif
)
: Define a rule.
-
[
`when`
](
#when
)
: May be set to
`always`
or
`never`
only. If not provided, the default value is
`always`
.
The list of
`if`
rules is evaluated until a single one is matched. If none
match, the last
`when`
will be used:
```
yaml
workflow
:
rules
:
-
if
:
$CI_COMMIT_REF_NAME =~ /-wip$/
when
:
never
-
if
:
$CI_COMMIT_TAG
when
:
never
-
when
:
always
```
### `include`
> - Introduced in [GitLab Premium](https://about.gitlab.com/pricing/) 10.5.
...
...
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