Commit 5c70072b authored by Suzanne Selhorn's avatar Suzanne Selhorn

Merge branch 'docs-yaml-default-keywords' into 'master'

Update default keyword and adjust yaml reference

See merge request gitlab-org/gitlab!73911
parents c5fbcdd5 59bb9f08
...@@ -82,6 +82,20 @@ For example: ...@@ -82,6 +82,20 @@ For example:
![Pipeline mini graph sorting](img/pipelines_mini_graph_sorting.png) ![Pipeline mini graph sorting](img/pipelines_mini_graph_sorting.png)
## Unavailable names for jobs
You can't use these keywords as job names:
- `image`
- `services`
- `stages`
- `types`
- `before_script`
- `after_script`
- `variables`
- `cache`
- `include`
## Group jobs in a pipeline ## Group jobs in a pipeline
If you have many similar jobs, your [pipeline graph](../pipelines/index.md#visualize-pipelines) becomes long and hard If you have many similar jobs, your [pipeline graph](../pipelines/index.md#visualize-pipelines) becomes long and hard
......
...@@ -141,7 +141,7 @@ The pipeline starts when the commit is committed. ...@@ -141,7 +141,7 @@ The pipeline starts when the commit is committed.
- You can also use [CI/CD configuration visualization](../pipeline_editor/index.md#visualize-ci-configuration) to - You can also use [CI/CD configuration visualization](../pipeline_editor/index.md#visualize-ci-configuration) to
view a graphical representation of your `.gitlab-ci.yml` file. view a graphical representation of your `.gitlab-ci.yml` file.
- Each job contains scripts and stages: - Each job contains scripts and stages:
- The [`default`](../yaml/index.md#custom-default-keyword-values) keyword is for - The [`default`](../yaml/index.md#default) keyword is for
custom defaults, for example with [`before_script`](../yaml/index.md#before_script) custom defaults, for example with [`before_script`](../yaml/index.md#before_script)
and [`after_script`](../yaml/index.md#after_script). and [`after_script`](../yaml/index.md#after_script).
- [`stage`](../yaml/index.md#stage) describes the sequential execution of jobs. - [`stage`](../yaml/index.md#stage) describes the sequential execution of jobs.
......
...@@ -69,7 +69,7 @@ You can include an array of configuration files: ...@@ -69,7 +69,7 @@ You can include an array of configuration files:
## Use `default` configuration from an included configuration file ## Use `default` configuration from an included configuration file
You can define a [`default`](index.md#custom-default-keyword-values) section in a You can define a [`default`](index.md#default) section in a
configuration file. When you use a `default` section with the `include` keyword, the defaults apply to configuration file. When you use a `default` section with the `include` keyword, the defaults apply to
all jobs in the pipeline. all jobs in the pipeline.
......
This diff is collapsed.
...@@ -62,7 +62,7 @@ job: ...@@ -62,7 +62,7 @@ job:
## Set a default `before_script` or `after_script` for all jobs ## Set a default `before_script` or `after_script` for all jobs
You can use [`before_script`](index.md#before_script) and [`after_script`](index.md#after_script) You can use [`before_script`](index.md#before_script) and [`after_script`](index.md#after_script)
with [`default`](index.md#custom-default-keyword-values): with [`default`](index.md#default):
- Use `before_script` with `default` to define a default array of commands that - Use `before_script` with `default` to define a default array of commands that
should run before the `script` commands in all jobs. should run before the `script` commands in all jobs.
......
...@@ -60,7 +60,7 @@ don't have any other `.gitlab-ci.yml` files. ...@@ -60,7 +60,7 @@ don't have any other `.gitlab-ci.yml` files.
When authoring pipeline templates: When authoring pipeline templates:
- Place any [global keywords](../../ci/yaml/index.md#global-keywords) like `image` - Place any [global keywords](../../ci/yaml/index.md#global-keywords) like `image`
or `before_script` in a [`default`](../../ci/yaml/index.md#custom-default-keyword-values) or `before_script` in a [`default`](../../ci/yaml/index.md#default)
section at the top of the template. section at the top of the template.
- Note clearly in the [code comments](#explain-the-template-with-comments) if the - Note clearly in the [code comments](#explain-the-template-with-comments) if the
template is designed to be used with the `includes` keyword in an existing template is designed to be used with the `includes` keyword in an existing
...@@ -77,7 +77,7 @@ other pipeline configuration. ...@@ -77,7 +77,7 @@ other pipeline configuration.
When authoring job templates: When authoring job templates:
- Do not use [global](../../ci/yaml/index.md#global-keywords) or [`default`](../../ci/yaml/index.md#custom-default-keyword-values) - Do not use [global](../../ci/yaml/index.md#global-keywords) or [`default`](../../ci/yaml/index.md#default)
keywords. When a root `.gitlab-ci.yml` includes a template, global or default keywords keywords. When a root `.gitlab-ci.yml` includes a template, global or default keywords
might be overridden and cause unexpected behavior. If a job template requires a might be overridden and cause unexpected behavior. If a job template requires a
specific stage, explain in the code comments that users must manually add the stage specific stage, explain in the code comments that users must manually add the stage
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment