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

Add docs for how to fetch artifacts from parent pipeline

上级 1c552004
No related branches found
No related tags found
无相关合并请求
......@@ -391,6 +391,50 @@ displays to the right of the mini graph.
## Fetch artifacts from an upstream pipeline **(PREMIUM)**
::Tabs
:::TabTitle Parent-child pipeline
Use [`needs:pipeline:job`](../yaml/index.md#needspipelinejob) to fetch artifacts from an
upstream pipeline:
1. In the upstream pipeline, save the artifacts in a job with the [`artifacts`](../yaml/index.md#artifacts)
keyword, then trigger the downstream pipeline with a trigger job:
```yaml
build_artifacts:
stage: build
script:
- echo "This is a test artifact!" >> artifact.txt
artifacts:
paths:
- artifact.txt
deploy:
stage: deploy
trigger:
include:
- local: path/to/child-pipeline.yml
variables:
PARENT_PIPELINE_ID: $CI_PIPELINE_ID
```
1. Use `needs:pipeline:job` in a job in the downstream pipeline to fetch the artifacts.
```yaml
test:
stage: test
script:
- cat artifact.txt
needs:
- pipeline: $PARENT_PIPELINE_ID
job: build_artifacts
```
Set `job` to the job in the upstream pipeline that created the artifacts.
:::TabTitle Multi-project pipeline
Use [`needs:project`](../yaml/index.md#needsproject) to fetch artifacts from an
upstream pipeline:
......@@ -408,7 +452,7 @@ upstream pipeline:
deploy:
stage: deploy
trigger: my/downstream_project
trigger: my/downstream_project # Path to the project to trigger a pipeline in
```
1. Use `needs:project` in a job in the downstream pipeline to fetch the artifacts.
......@@ -431,6 +475,8 @@ upstream pipeline:
- `ref` to the branch.
- `artifacts` to `true`.
::EndTabs
### Fetch artifacts from an upstream merge request pipeline
When you use `needs:project` to [pass artifacts to a downstream pipeline](#fetch-artifacts-from-an-upstream-pipeline),
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册