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
1a83cab2
Commit
1a83cab2
authored
Aug 20, 2020
by
Suzanne Selhorn
Committed by
Marcel Amirault
Aug 20, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More Vale fixes in CI YAML file
Related to:
https://gitlab.com/gitlab-org/gitlab/-/issues/234029
parent
25cc6474
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
20 deletions
+20
-20
doc/ci/yaml/README.md
doc/ci/yaml/README.md
+20
-20
No files found.
doc/ci/yaml/README.md
View file @
1a83cab2
...
@@ -926,14 +926,14 @@ For example, the following are equivalent configuration:
...
@@ -926,14 +926,14 @@ For example, the following are equivalent configuration:
```
```
NOTE:
**Note:**
NOTE:
**Note:**
A pipeline
won't be created if it only contains jobs
in
`.pre`
or
`.post`
stages.
A pipeline
is not created if all jobs are
in
`.pre`
or
`.post`
stages.
### `extends`
### `extends`
> Introduced in GitLab 11.3.
> Introduced in GitLab 11.3.
`extends`
defines entry names that a job that uses
`extends`
is going to
`extends`
defines entry names that a job that uses
`extends`
inherit from.
inherit
s
from.
It's an alternative to using
[
YAML anchors
](
#anchors
)
and is a little
It's an alternative to using
[
YAML anchors
](
#anchors
)
and is a little
more flexible and readable:
more flexible and readable:
...
@@ -955,12 +955,12 @@ rspec:
...
@@ -955,12 +955,12 @@ rspec:
```
```
In the example above, the
`rspec`
job inherits from the
`.tests`
template job.
In the example above, the
`rspec`
job inherits from the
`.tests`
template job.
GitLab
will perform a reverse deep merge based on the keys. GitLab will
:
GitLab
performs a reverse deep merge based on the keys. GitLab
:
-
Merge the
`rspec`
contents into
`.tests`
recursively.
-
Merge
s
the
`rspec`
contents into
`.tests`
recursively.
-
No
t merge the values of the keys.
-
Doesn'
t merge the values of the keys.
Th
is results in the following
`rspec`
job:
Th
e result is this
`rspec`
job:
```
yaml
```
yaml
rspec
:
rspec
:
...
@@ -981,8 +981,8 @@ If you do want to include the `rake test`, see [`before_script` and `after_scrip
...
@@ -981,8 +981,8 @@ If you do want to include the `rake test`, see [`before_script` and `after_scrip
`.tests`
in this example is a
[
hidden job
](
#hide-jobs
)
, but it's
`.tests`
in this example is a
[
hidden job
](
#hide-jobs
)
, but it's
possible to inherit from regular jobs as well.
possible to inherit from regular jobs as well.
`extends`
supports multi-level inheritance
, however it's not recommended to
`extends`
supports multi-level inheritance
. You should avoid using more than 3 levels,
use more than three levels. The maximum nesting level that is supported is 10
.
but you can use as many as ten
.
The following example has two levels of inheritance:
The following example has two levels of inheritance:
```
yaml
```
yaml
...
@@ -1016,7 +1016,7 @@ In GitLab 12.0 and later, it's also possible to use multiple parents for
...
@@ -1016,7 +1016,7 @@ In GitLab 12.0 and later, it's also possible to use multiple parents for
`extends`
is able to merge hashes but not arrays.
`extends`
is able to merge hashes but not arrays.
The algorithm used for merge is "closest scope wins", so
The algorithm used for merge is "closest scope wins", so
keys from the last member
will
always override anything defined on other
keys from the last member always override anything defined on other
levels. For example:
levels. For example:
```
yaml
```
yaml
...
@@ -1098,7 +1098,7 @@ useTemplate:
...
@@ -1098,7 +1098,7 @@ useTemplate:
extends
:
.template
extends
:
.template
```
```
This
will run
a job called
`useTemplate`
that runs
`echo Hello!`
as defined in
This
example runs
a job called
`useTemplate`
that runs
`echo Hello!`
as defined in
the
`.template`
job, and uses the
`alpine`
Docker image as defined in the local job.
the
`.template`
job, and uses the
`alpine`
Docker image as defined in the local job.
### `rules`
### `rules`
...
@@ -1113,8 +1113,8 @@ If included, the job also has [certain attributes](#rules-attributes)
...
@@ -1113,8 +1113,8 @@ If included, the job also has [certain attributes](#rules-attributes)
added to it.
added to it.
CAUTION:
**Caution:**
CAUTION:
**Caution:**
`rules`
can't be used in combination with
[
`only/except`
](
#onlyexcept-basic
)
because it is a replacement for
`rules`
replaces
[
`only/except`
](
#onlyexcept-basic
)
and can't be used in conjunction with it.
that functionality. If you attempt to do this
, the linter returns a
If you attempt to use both keywords in the same job
, the linter returns a
`key may not be used with rules`
error.
`key may not be used with rules`
error.
#### Rules attributes
#### Rules attributes
...
@@ -1466,7 +1466,7 @@ use `when: never`.
...
@@ -1466,7 +1466,7 @@ use `when: never`.
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/24021) in GitLab 12.4.
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/24021) in GitLab 12.4.
`exists`
accepts an array of paths and
will match
if any of these paths exist
`exists`
accepts an array of paths and
matches
if any of these paths exist
as files in the repository.
as files in the repository.
For example:
For example:
...
@@ -1494,7 +1494,7 @@ job:
...
@@ -1494,7 +1494,7 @@ job:
NOTE:
**Note:**
NOTE:
**Note:**
For performance reasons, using
`exists`
with patterns is limited to 10000
For performance reasons, using
`exists`
with patterns is limited to 10000
checks. After the 10000th check, rules with patterned globs
will
always match.
checks. After the 10000th check, rules with patterned globs always match.
#### `rules:allow_failure`
#### `rules:allow_failure`
...
@@ -1517,18 +1517,18 @@ job:
...
@@ -1517,18 +1517,18 @@ job:
allow_failure
:
true
allow_failure
:
true
```
```
In this example, if the first rule matches, then the job
will have
`when: manual`
and
`allow_failure: true`
.
In this example, if the first rule matches, then the job
has
`when: manual`
and
`allow_failure: true`
.
#### Complex rule clauses
#### Complex rule clauses
To conjoin
`if`
,
`changes`
, and
`exists`
clauses with an
AND
, use them in the
To conjoin
`if`
,
`changes`
, and
`exists`
clauses with an
`AND`
, use them in the
same rule.
same rule.
In the following example:
In the following example:
-
We run the job manually if
`Dockerfile`
or any file in
`docker/scripts/`
-
If the dockerfile or any file in
`/docker/scripts`
has changed, and var=blah,
has changed AND
`$VAR == "string value"`
.
then the job runs manually
-
Otherwise, the job
won't be
included in the pipeline.
-
Otherwise, the job
isn't
included in the pipeline.
```
yaml
```
yaml
docker build
:
docker build
:
...
...
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