Skip to content
代码片段 群组 项目
未验证 提交 a4ccd1f5 编辑于 作者: Lysanne Pinto's avatar Lysanne Pinto 提交者: GitLab
浏览文件

Merge branch 'docs-mr-pipelines-old-screenshot' into 'master'

Remove outdated screenshot and details

See merge request https://gitlab.com/gitlab-org/gitlab/-/merge_requests/148625



Merged-by: default avatarLysanne Pinto <lpinto@gitlab.com>
Approved-by: default avatarLysanne Pinto <lpinto@gitlab.com>
Co-authored-by: default avatarMarcel Amirault <mamirault@gitlab.com>
No related branches found
No related tags found
无相关合并请求
doc/ci/pipelines/img/pipeline_fork_v13_7.png

15.3 KB

...@@ -10,8 +10,6 @@ DETAILS: ...@@ -10,8 +10,6 @@ DETAILS:
**Tier:** Free, Premium, Ultimate **Tier:** Free, Premium, Ultimate
**Offering:** GitLab.com, Self-managed, GitLab Dedicated **Offering:** GitLab.com, Self-managed, GitLab Dedicated
> [Renamed](https://gitlab.com/gitlab-org/gitlab/-/issues/351192) from `pipelines for merge requests` to `merge request pipelines` in GitLab 14.8.
You can configure your pipeline to run every time you make changes to the You can configure your pipeline to run every time you make changes to the
source branch in a merge request. source branch in a merge request.
...@@ -37,15 +35,13 @@ and target branches together, use merged results pipelines. ...@@ -37,15 +35,13 @@ and target branches together, use merged results pipelines.
To use merge request pipelines: To use merge request pipelines:
- Your project's [`.gitlab-ci.yml` file](../index.md#the-gitlab-ciyml-file) must be configured with - Your project's [`.gitlab-ci.yml` file](../index.md#the-gitlab-ciyml-file) must be
jobs that run in merge request pipelines. To do this, you can use: [configured with jobs that run in merge request pipelines](#add-jobs-to-merge-request-pipelines).
- [`rules`](#use-rules-to-add-jobs).
- [`only/except`](#use-only-to-add-jobs).
- You must have at least the Developer role in the - You must have at least the Developer role in the
source project to run a merge request pipeline. source project to run a merge request pipeline.
- Your repository must be a GitLab repository, not an [external repository](../ci_cd_for_external_repos/index.md). - Your repository must be a GitLab repository, not an [external repository](../ci_cd_for_external_repos/index.md).
## Use `rules` to add jobs ## Add jobs to merge request pipelines
Use the [`rules`](../yaml/index.md#rules) keyword to configure jobs to run in Use the [`rules`](../yaml/index.md#rules) keyword to configure jobs to run in
merge request pipelines. For example: merge request pipelines. For example:
...@@ -85,25 +81,8 @@ workflow: ...@@ -85,25 +81,8 @@ workflow:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
``` ```
## Use `only` to add jobs
[`rules`](#use-rules-to-add-jobs) is the preferred method, but you can also use
the [`only`](../yaml/index.md#onlyrefs--exceptrefs) keyword with `merge_requests`
to configure jobs to run in merge request pipelines. For example:
```yaml
job1:
script:
- echo "This job runs in merge request pipelines"
only:
- merge_requests
```
## Use with forked projects ## Use with forked projects
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/217451) in GitLab 13.3.
> - [Moved](https://about.gitlab.com/blog/2021/01/26/new-gitlab-product-subscription-model/) to GitLab Premium in 13.9.
External contributors who work in forks can't create pipelines in the parent project. External contributors who work in forks can't create pipelines in the parent project.
A merge request from a fork that is submitted to the parent project triggers a A merge request from a fork that is submitted to the parent project triggers a
...@@ -112,9 +91,7 @@ pipeline that: ...@@ -112,9 +91,7 @@ pipeline that:
- Is created and runs in the fork (source) project, not the parent (target) project. - Is created and runs in the fork (source) project, not the parent (target) project.
- Uses the fork project's CI/CD configuration, resources, and project CI/CD variables. - Uses the fork project's CI/CD configuration, resources, and project CI/CD variables.
Pipelines for forks display with the **fork** badge in the parent project: Pipelines for forks display with the **fork** badge in the parent project.
![Pipeline ran in fork](img/pipeline_fork_v13_7.png)
### Run pipelines in the parent project ### Run pipelines in the parent project
......
...@@ -263,7 +263,7 @@ to replace those values at runtime when each review app is created: ...@@ -263,7 +263,7 @@ to replace those values at runtime when each review app is created:
variable or on the [project overview page](../../user/project/working_with_projects.md#access-the-project-overview-page-by-using-the-project-id). variable or on the [project overview page](../../user/project/working_with_projects.md#access-the-project-overview-page-by-using-the-project-id).
- `data-merge-request-id` is the merge request ID, which can be found by the - `data-merge-request-id` is the merge request ID, which can be found by the
`CI_MERGE_REQUEST_IID` variable. `CI_MERGE_REQUEST_IID` is available only if `CI_MERGE_REQUEST_IID` variable. `CI_MERGE_REQUEST_IID` is available only if
[`rules:if: $CI_PIPELINE_SOURCE == "merge_request_event`](../pipelines/merge_request_pipelines.md#use-rules-to-add-jobs) [`rules:if: $CI_PIPELINE_SOURCE == "merge_request_event`](../pipelines/merge_request_pipelines.md#add-jobs-to-merge-request-pipelines)
is used and the merge request is created. is used and the merge request is created.
- `data-mr-url` is the URL of the GitLab instance and is the same for all - `data-mr-url` is the URL of the GitLab instance and is the same for all
review apps. review apps.
......
...@@ -672,7 +672,7 @@ and the pipeline is for either: ...@@ -672,7 +672,7 @@ and the pipeline is for either:
- You can use the [`workflow:rules` templates](workflow.md#workflowrules-templates) to import - You can use the [`workflow:rules` templates](workflow.md#workflowrules-templates) to import
a preconfigured `workflow: rules` entry. a preconfigured `workflow: rules` entry.
- [Common `if` clauses for `workflow:rules`](workflow.md#common-if-clauses-for-workflowrules). - [Common `if` clauses for `workflow:rules`](workflow.md#common-if-clauses-for-workflowrules).
- [Use `rules` to run merge request pipelines](../pipelines/merge_request_pipelines.md#use-rules-to-add-jobs). - [Use `rules` to run merge request pipelines](../pipelines/merge_request_pipelines.md#add-jobs-to-merge-request-pipelines).
#### `workflow:rules:variables` #### `workflow:rules:variables`
...@@ -4034,7 +4034,7 @@ job: ...@@ -4034,7 +4034,7 @@ job:
- [Common `if` expressions for `rules`](../jobs/job_control.md#common-if-clauses-for-rules). - [Common `if` expressions for `rules`](../jobs/job_control.md#common-if-clauses-for-rules).
- [Avoid duplicate pipelines](../jobs/job_control.md#avoid-duplicate-pipelines). - [Avoid duplicate pipelines](../jobs/job_control.md#avoid-duplicate-pipelines).
- [Use `rules` to run merge request pipelines](../pipelines/merge_request_pipelines.md#use-rules-to-add-jobs). - [Use `rules` to run merge request pipelines](../pipelines/merge_request_pipelines.md#add-jobs-to-merge-request-pipelines).
#### `rules:changes` #### `rules:changes`
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册