Skip to content
代码片段 群组 项目
提交 de95bfd5 编辑于 作者: Marcel Amirault's avatar Marcel Amirault
浏览文件

Change include:file to include:project in yaml reference

上级 77c56169
No related branches found
No related tags found
无相关合并请求
...@@ -149,8 +149,8 @@ job3: ...@@ -149,8 +149,8 @@ job3:
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/205157) in GitLab 13.5. > [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/205157) in GitLab 13.5.
You can use [`include:file`](../yaml/index.md#includefile) to trigger child pipelines You can use [`include:project`](../yaml/index.md#includeproject) in a trigger job
with a configuration file in a different project: to trigger child pipelines with a configuration file in a different project:
```yaml ```yaml
microservice_a: microservice_a:
......
...@@ -146,7 +146,7 @@ the time limit to resolve all files is 30 seconds. ...@@ -146,7 +146,7 @@ the time limit to resolve all files is 30 seconds.
**Possible inputs**: The `include` subkeys: **Possible inputs**: The `include` subkeys:
- [`include:local`](#includelocal) - [`include:local`](#includelocal)
- [`include:file`](#includefile) - [`include:project`](#includeproject)
- [`include:remote`](#includeremote) - [`include:remote`](#includeremote)
- [`include:template`](#includetemplate) - [`include:template`](#includetemplate)
...@@ -203,58 +203,52 @@ include: '.gitlab-ci-production.yml' ...@@ -203,58 +203,52 @@ include: '.gitlab-ci-production.yml'
- All [nested includes](includes.md#use-nested-includes) are executed in the scope of the same project, - All [nested includes](includes.md#use-nested-includes) are executed in the scope of the same project,
so you can use local, project, remote, or template includes. so you can use local, project, remote, or template includes.
#### `include:file` #### `include:project`
> Including multiple files from the same project [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/26793) in GitLab 13.6. [Feature flag removed](https://gitlab.com/gitlab-org/gitlab/-/issues/271560) in GitLab 13.8. > Including multiple files from the same project [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/26793) in GitLab 13.6. [Feature flag removed](https://gitlab.com/gitlab-org/gitlab/-/issues/271560) in GitLab 13.8.
To include files from another private project on the same GitLab instance, To include files from another private project on the same GitLab instance,
use `include:file`. You can use `include:file` in combination with `include:project` only. use `include:project` and `include:file`.
**Keyword type**: Global keyword. **Keyword type**: Global keyword.
**Possible inputs**: **Possible inputs**:
A full path, relative to the root directory (`/`): - `include:project`: The full GitLab project path.
- `include:file` A full file path, or array of file paths, relative to the root directory (`/`).
The YAML files must have the `.yml` or `.yaml` extension.
- `include:ref`: Optional. The ref to retrieve the file from. Defaults to the `HEAD` of the project
when not specified.
- The YAML file must have the extension `.yml` or `.yaml`. You can use [certain CI/CD variables](includes.md#use-variables-with-include).
- You can use [certain CI/CD variables](includes.md#use-variables-with-include).
**Example of `include:file`**: **Example of `include:project`**:
```yaml ```yaml
include: include:
- project: 'my-group/my-project' - project: 'my-group/my-project'
file: '/templates/.gitlab-ci-template.yml' file: '/templates/.gitlab-ci-template.yml'
- project: 'my-group/my-subgroup/my-project-2'
file:
- '/templates/.builds.yml'
- '/templates/.tests.yml'
``` ```
You can also specify a `ref`. If you do not specify a value, the ref defaults to the `HEAD` of the project: You can also specify a `ref`:
```yaml ```yaml
include: include:
- project: 'my-group/my-project' - project: 'my-group/my-project'
ref: main ref: main # Git branch
file: '/templates/.gitlab-ci-template.yml' file: '/templates/.gitlab-ci-template.yml'
- project: 'my-group/my-project' - project: 'my-group/my-project'
ref: v1.0.0 # Git Tag ref: v1.0.0 # Git Tag
file: '/templates/.gitlab-ci-template.yml' file: '/templates/.gitlab-ci-template.yml'
- project: 'my-group/my-project' - project: 'my-group/my-project'
ref: 787123b47f14b552955ca2786bc9542ae66fee5b # Git SHA ref: 787123b47f14b552955ca2786bc9542ae66fee5b # Git SHA
file: '/templates/.gitlab-ci-template.yml' file: '/templates/.gitlab-ci-template.yml'
``` ```
You can include multiple files from the same project:
```yaml
include:
- project: 'my-group/my-project'
ref: main
file:
- '/templates/.builds.yml'
- '/templates/.tests.yml'
```
**Additional details**: **Additional details**:
- All [nested includes](includes.md#use-nested-includes) are executed in the scope of the target project. - All [nested includes](includes.md#use-nested-includes) are executed in the scope of the target project.
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册