diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-21 12:09:01 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-21 12:09:01 +0300 |
commit | a53d2c37c4934f564caa94543dd4cf5af1703e2d (patch) | |
tree | a028dc39771a4612a9845ab700a73af2d6f3f51b /doc/ci | |
parent | 18b8435318887d3fc6e9f9d305967a953cdd7d3f (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'doc/ci')
-rw-r--r-- | doc/ci/parent_child_pipelines.md | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/doc/ci/parent_child_pipelines.md b/doc/ci/parent_child_pipelines.md index 387f2e69606..f8d100b83b8 100644 --- a/doc/ci/parent_child_pipelines.md +++ b/doc/ci/parent_child_pipelines.md @@ -80,6 +80,52 @@ microservice_a: strategy: depend ``` +## Merge Request child pipelines + +To trigger a child pipeline as a [Merge Request Pipeline](merge_request_pipelines/index.md) we need to: + +- Set the trigger job to run on merge requests: + +```yaml +# parent .gitlab-ci.yml +microservice_a: + trigger: + include: path/to/microservice_a.yml + rules: + - if: $CI_MERGE_REQUEST_ID +``` + +- Configure the child pipeline by either: + + - Setting all jobs in the child pipeline to evaluate in the context of a merge request: + + ```yaml + # child path/to/microservice_a.yml + workflow: + rules: + - if: $CI_MERGE_REQUEST_ID + + job1: + script: ... + + job2: + script: ... + ``` + + - Alternatively, setting the rule per job. For example, to create only `job1` in + the context of merge request pipelines: + + ```yaml + # child path/to/microservice_a.yml + job1: + script: ... + rules: + - if: $CI_MERGE_REQUEST_ID + + job2: + script: ... + ``` + ## Limitations A parent pipeline can trigger many child pipelines, but a child pipeline cannot trigger |