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
03564450
Commit
03564450
authored
Jul 07, 2020
by
Marcel Amirault
Committed by
Suzanne Selhorn
Jul 07, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update `when` details for `rules`
parent
21061935
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
doc/ci/yaml/README.md
doc/ci/yaml/README.md
+8
-5
No files found.
doc/ci/yaml/README.md
View file @
03564450
...
...
@@ -1088,7 +1088,7 @@ The job attributes allowed by `rules` are:
-
If used as
`when: delayed`
,
`start_in`
is also required.
-
[
`allow_failure`
](
#allow_failure
)
: If not defined, defaults to
`allow_failure: false`
.
If
`when`
is evaluated to
any value except
`never`
, the job is included in the pipeline.
If
a rule evaluates to true, and
`when`
has
any value except
`never`
, the job is included in the pipeline.
For example:
...
...
@@ -1189,10 +1189,11 @@ for more details.
#### Differences between `rules` and `only`/`except`
A very important difference between
`rules`
and
`only/except`
, is that jobs defined
with
`only/except`
do not trigger merge request pipelines without explicit configuration.
`rules`
*can*
trigger all types of pipelines, without explicitly configuring each
type.
Jobs defined with
`only/except`
do not trigger merge request pipelines by default.
You must explicitly add
`only: merge_requests`
.
Jobs defined with
`rules`
can trigger all types of pipelines.
You do not have to explicitly configure each type.
For example:
...
...
@@ -1259,6 +1260,8 @@ Some details regarding the logic that determines the `when` for the job:
rule without
`if`
or
`changes`
, always matches, and is always used if reached.
-
If a rule matches and has no
`when`
defined, the rule uses the
`when`
defined for the job, which defaults to
`on_success`
if not defined.
-
You can define
`when`
once per rule, or once at the job-level, which applies to
all rules. You can't mix
`when`
at the job-level with
`when`
in rules.
For behavior similar to the
[
`only`/`except` keywords
](
#onlyexcept-basic
)
, you can
check the value of the
`$CI_PIPELINE_SOURCE`
variable.
...
...
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