summaryrefslogtreecommitdiff
path: root/doc/ci
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-03-16 15:09:27 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-16 15:09:27 +0000
commit8d4aaa4dd07cd02383f7d09d74eb66ffe47a41c4 (patch)
tree684210b8b7c8b5664e8d7b529e59ffde6bcfaed4 /doc/ci
parentcbfe03ae04a52d9825ff7cbeccdfe5d313adf6a2 (diff)
downloadgitlab-ce-8d4aaa4dd07cd02383f7d09d74eb66ffe47a41c4.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'doc/ci')
-rw-r--r--doc/ci/parent_child_pipelines.md17
-rw-r--r--doc/ci/yaml/README.md25
2 files changed, 41 insertions, 1 deletions
diff --git a/doc/ci/parent_child_pipelines.md b/doc/ci/parent_child_pipelines.md
index f8d100b83b8..2ce69a04939 100644
--- a/doc/ci/parent_child_pipelines.md
+++ b/doc/ci/parent_child_pipelines.md
@@ -126,7 +126,22 @@ microservice_a:
script: ...
```
+## Dynamic child pipelines
+
+> [Introduced](https://gitlab.com/gitlab-org/gitlab/issues/35632) in GitLab 12.9.
+
+Instead of running a child pipeline from a static YAML file, you can define a job that runs
+your own script to generate a YAML file, which is then [used to trigger a child pipeline](yaml/README.md#trigger-child-pipeline-with-generated-configuration-file).
+
+This technique can be very powerful in generating pipelines targeting content that changed or to
+build a matrix of targets and architectures.
+
## Limitations
A parent pipeline can trigger many child pipelines, but a child pipeline cannot trigger
-further child pipelines. See the [related issue](https://gitlab.com/gitlab-org/gitlab/issues/29651) for discussion on possible future improvements.
+further child pipelines. See the [related issue](https://gitlab.com/gitlab-org/gitlab/issues/29651)
+for discussion on possible future improvements.
+
+When triggering dynamic child pipelines, if the job containing the CI config artifact is not a predecessor of the
+trigger job, the child pipeline will fail to be created, causing also the parent pipeline to fail.
+In the future we want to validate the trigger job's dependencies [at the time the parent pipeline is created](https://gitlab.com/gitlab-org/gitlab/-/issues/209070) rather than when the child pipeline is created.
diff --git a/doc/ci/yaml/README.md b/doc/ci/yaml/README.md
index 1441526bc80..21eca42d8e7 100644
--- a/doc/ci/yaml/README.md
+++ b/doc/ci/yaml/README.md
@@ -2899,6 +2899,31 @@ trigger_job:
strategy: depend
```
+##### Trigger child pipeline with generated configuration file
+
+> [Introduced](https://gitlab.com/gitlab-org/gitlab/issues/35632) in GitLab 12.9.
+
+You can also trigger a child pipeline from a [dynamically generated configuration file](../parent_child_pipelines.md#dynamic-child-pipelines):
+
+```yaml
+generate-config:
+ stage: build
+ script: generate-ci-config > generated-config.yml
+ artifacts:
+ paths:
+ - generated-config.yml
+
+child-pipeline:
+ stage: test
+ trigger:
+ include:
+ - artifact: generated-config.yml
+ job: generate-config
+```
+
+The `generated-config.yml` is extracted from the artifacts and used as the configuration
+for triggering the child pipeline.
+
#### Linking pipelines with `trigger:strategy`
By default, the `trigger` job completes with the `success` status